summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-02-07 10:02:10 +0000
committerNick Thomas <nick@gitlab.com>2019-02-07 10:02:10 +0000
commit198ba5a05134bdb2047bb7cd28e91e2116119cf7 (patch)
tree3ef1c2672b9d7da3a45bbb05298827522c5c68d5
parentd91b96458e59345dd9ad5b9e3d03a12db6c78270 (diff)
parent24f3f9600484efcf088c73509a4f3c72fc30fff0 (diff)
downloadgitlab-ce-198ba5a05134bdb2047bb7cd28e91e2116119cf7.tar.gz
Merge branch 'ce-jej/group-saml-sso-when-signed-out' into 'master'
[CE] Backport build_auth_user for GroupSAML callback See merge request gitlab-org/gitlab-ce!24979
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index 97120273d6b..cc2bb99f55b 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -116,8 +116,12 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
session[:service_tickets][provider] = ticket
end
+ def build_auth_user(auth_user_class)
+ auth_user_class.new(oauth)
+ end
+
def sign_in_user_flow(auth_user_class)
- auth_user = auth_user_class.new(oauth)
+ auth_user = build_auth_user(auth_user_class)
user = auth_user.find_and_update!
if auth_user.valid_sign_in?