Catch error when server decryption fails on 2FA (#2512)
This commit is contained in:
parent
1736badf28
commit
b48f2cbc8b
2 changed files with 19 additions and 0 deletions
|
@ -51,6 +51,8 @@ class Auth::SessionsController < Devise::SessionsController
|
|||
def valid_otp_attempt?(user)
|
||||
user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
|
||||
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
|
||||
rescue OpenSSL::Cipher::CipherError => error
|
||||
false
|
||||
end
|
||||
|
||||
def authenticate_with_two_factor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue