Commit 54c514f2 authored by Patricio Cano's avatar Patricio Cano

Add 2FA check to the OAuth authentication mechanism

parent 79fd3c7b
...@@ -107,6 +107,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController ...@@ -107,6 +107,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
# Only allow properly saved users to login. # Only allow properly saved users to login.
if @user.persisted? && @user.valid? if @user.persisted? && @user.valid?
log_audit_event(@user, with: oauth['provider']) log_audit_event(@user, with: oauth['provider'])
prompt_for_two_factor(@user) and return if @user.two_factor_enabled?
sign_in_and_redirect(@user) sign_in_and_redirect(@user)
else else
error_message = @user.errors.full_messages.to_sentence error_message = @user.errors.full_messages.to_sentence
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment