From 7ae327966c0cf70608f70729975edc14335a294a 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/accounts.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/accounts.cr b/src/invidious/routes/accounts.cr index f8728035..bedb333a 100644 --- a/src/invidious/routes/accounts.cr +++ b/src/invidious/routes/accounts.cr @@ -8,7 +8,7 @@ class Invidious::Routes::Accounts < Invidious::Routes::BaseRoute user = env.get? "user" sid = env.get? "sid" - referer = get_referer(env) + referer = get_referer(env, unroll: false) user = user.as(User) sid = sid.as(String) @@ -92,6 +92,7 @@ class Invidious::Routes::Accounts < Invidious::Routes::BaseRoute 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