From e93c8672b4e4f9fc494ca647347ae7411136cff8 Mon Sep 17 00:00:00 2001 From: syeopite Date: Fri, 16 Jul 2021 14:34:31 -0700 Subject: [PATCH] Redirect to referer after 2fa removal --- 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 0cead392..2f3194f3 100644 --- a/src/invidious/routes/account.cr +++ b/src/invidious/routes/account.cr @@ -524,7 +524,7 @@ module Invidious::Routes::Account return templated "user/remove_2fa" end - # Remove 2fa post request. + # Handles requests to remove 2fa on an user account def remove_2fa(env) locale = env.get("preferences").as(Preferences).locale @@ -547,5 +547,6 @@ module Invidious::Routes::Account end PG_DB.exec("UPDATE users SET totp_secret = $1 WHERE email = $2", nil, user.email) + env.redirect referer end end