Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-06-29 19:55:23 +0300
committerPatricio Cano <suprnova32@gmail.com>2016-06-29 19:55:23 +0300
commit54c514f24ee00d885ec633a137a78a4cc71c6781 (patch)
treeaf9ed45baffde2b28cda2370a6d7cae8b49d7b6a /app/controllers/omniauth_callbacks_controller.rb
parent79fd3c7b9e152c46b1c600bc645f4da65006242e (diff)
Add 2FA check to the OAuth authentication mechanism
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb1
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