mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Only allow totp removal endpoint for users w/ 2fa
This commit is contained in:
parent
413de9c0b1
commit
c7b3657878
1 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ class Invidious::Routes::Accounts < Invidious::Routes::BaseRoute
|
|||
sid = env.get? "sid"
|
||||
referer = get_referer(env, unroll: false)
|
||||
|
||||
if !user
|
||||
if !user || user.is_a? User && !user.totp_secret
|
||||
return env.redirect referer
|
||||
end
|
||||
|
||||
|
@ -54,7 +54,7 @@ class Invidious::Routes::Accounts < Invidious::Routes::BaseRoute
|
|||
sid = env.get? "sid"
|
||||
referer = get_referer(env, unroll: false)
|
||||
|
||||
if !user
|
||||
if !user || user.is_a? User && !user.totp_secret
|
||||
return env.redirect referer
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue