about summary refs log tree commit diff
path: root/app/controllers/auth/sessions_controller.rb
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-27 09:18:21 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-04-27 15:18:21 +0200
commitb48f2cbc8b6b260a8d9b51a26e484a7da1694851 (patch)
tree1d76a8e5dd8ec92237516963628ac734a02d13da /app/controllers/auth/sessions_controller.rb
parent1736badf28eae2ba42e42f9fef2e151e35d5397a (diff)
Catch error when server decryption fails on 2FA (#2512)
Diffstat (limited to 'app/controllers/auth/sessions_controller.rb')
-rw-r--r--app/controllers/auth/sessions_controller.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb
index a187ae6da..09e67ec59 100644
--- a/app/controllers/auth/sessions_controller.rb
+++ b/app/controllers/auth/sessions_controller.rb
@@ -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