Add 2FA check to the OAuth authentication mechanism

This commit is contained in:
Patricio Cano 2016-06-29 11:55:23 -05:00
parent 79fd3c7b9e
commit 54c514f24e
1 changed files with 1 additions and 0 deletions

View File

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