0
0
Fork 0

Catch error when server decryption fails on 2FA (#2512)

This commit is contained in:
Matt Jankowski 2017-04-27 09:18:21 -04:00 committed by Eugen Rochko
parent 1736badf28
commit b48f2cbc8b
2 changed files with 19 additions and 0 deletions

View file

@ -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