Fix referrer for setup_2fa page

This commit is contained in:
syeopite 2021-07-15 02:45:23 -07:00
parent 946275c187
commit 7ae327966c
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82

View file

@ -8,7 +8,7 @@ class Invidious::Routes::Accounts < Invidious::Routes::BaseRoute
user = env.get? "user" user = env.get? "user"
sid = env.get? "sid" sid = env.get? "sid"
referer = get_referer(env) referer = get_referer(env, unroll: false)
user = user.as(User) user = user.as(User)
sid = sid.as(String) sid = sid.as(String)
@ -92,6 +92,7 @@ class Invidious::Routes::Accounts < Invidious::Routes::BaseRoute
end end
PG_DB.exec("UPDATE users SET totp_secret = $1 WHERE email = $2", db_secret.to_s, user.email) PG_DB.exec("UPDATE users SET totp_secret = $1 WHERE email = $2", db_secret.to_s, user.email)
env.redirect referer
end end
# Validate 2fa code endpoint # Validate 2fa code endpoint