diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-30 22:54:07 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-04 19:00:34 +0300 |
commit | 5467260528018774c8baec65f3cbf692bb3d93b7 (patch) | |
tree | 031189c2b675941eb500e7ffa70394c21980dad2 /app | |
parent | 54c514f24ee00d885ec633a137a78a4cc71c6781 (diff) |
Added tests for 2FA check on OAuth request
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 619a76ebfd9..f54c79c2e37 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -107,8 +107,11 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController # Only allow properly saved users to login. if @user.persisted? && @user.valid? log_audit_event(@user, with: oauth['provider']) - prompt_for_two_factor(@user) and return if @user.two_factor_enabled? - sign_in_and_redirect(@user) + if @user.two_factor_enabled? + prompt_for_two_factor(@user) + else + sign_in_and_redirect(@user) + end else error_message = @user.errors.full_messages.to_sentence |