mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 19:45:08 +00:00
require 2fa on CURRENT session
This commit is contained in:
parent
6c1b4c787c
commit
62330ede44
1 changed files with 3 additions and 2 deletions
|
|
@ -45,8 +45,9 @@ module Backend
|
|||
end
|
||||
|
||||
def require_2fa!
|
||||
unless current_identity&.use_two_factor_authentication?
|
||||
redirect_to root_path, alert: "You must enable Two-Factor Authentication to access the backend."
|
||||
login_attempt = current_session&.login_attempt
|
||||
unless login_attempt&.authenticated_with_totp || login_attempt&.authenticated_with_webauthn
|
||||
redirect_to root_path, alert: "You must authenticate with TOTP or passkey to access the backend."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue