From 2bf8bfd5de1d19dfdbd603eefe754a6f2dc843be Mon Sep 17 00:00:00 2001 From: syeopite Date: Thu, 15 Jul 2021 02:45:23 -0700 Subject: [PATCH] Fix referrer for setup_2fa page --- src/invidious/routes/account.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/account.cr b/src/invidious/routes/account.cr index d5b6ce42..b5cbd188 100644 --- a/src/invidious/routes/account.cr +++ b/src/invidious/routes/account.cr @@ -397,7 +397,7 @@ module Invidious::Routes::Account user = env.get? "user" sid = env.get? "sid" - referer = get_referer(env) + referer = get_referer(env, unroll: false) if !user return env.redirect referer @@ -425,6 +425,7 @@ module Invidious::Routes::Account end PG_DB.exec("UPDATE users SET totp_secret = $1 WHERE email = $2", db_secret.to_s, user.email) + env.redirect referer end # Validate 2fa code endpoint