diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-29 19:55:23 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-06-29 19:55:23 +0300 |
commit | 54c514f24ee00d885ec633a137a78a4cc71c6781 (patch) | |
tree | af9ed45baffde2b28cda2370a6d7cae8b49d7b6a | |
parent | 79fd3c7b9e152c46b1c600bc645f4da65006242e (diff) |
Add 2FA check to the OAuth authentication mechanism
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index f35d631df0c..619a76ebfd9 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -107,6 +107,7 @@ 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) else error_message = @user.errors.full_messages.to_sentence |