summaryrefslogtreecommitdiff
path: root/app/services/users
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-06-26 13:11:30 -0700
committerStan Hu <stanhu@gmail.com>2019-06-27 21:20:33 -0700
commit867d810d8a9a0790e6051a96dc0b1fdb883ddbf6 (patch)
treed326140aba1b323818ada0b939e251209d24910a /app/services/users
parent732ee60693c5986f9041b05665588306eefd69d9 (diff)
downloadgitlab-ce-867d810d8a9a0790e6051a96dc0b1fdb883ddbf6.tar.gz
Backport CE changes for multiple GroupSAML supportsh-fix-issue-12303
This commit makes it possible for https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14420 to handle multiple SAML providers.
Diffstat (limited to 'app/services/users')
-rw-r--r--app/services/users/update_service.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb
index 15c13a452ad..8f52e9cb23f 100644
--- a/app/services/users/update_service.rb
+++ b/app/services/users/update_service.rb
@@ -63,12 +63,20 @@ module Users
def assign_identity
return unless identity_params.present?
- identity = user.identities.find_or_create_by(provider: identity_params[:provider]) # rubocop: disable CodeReuse/ActiveRecord
+ identity = user.identities.find_or_create_by(provider_params) # rubocop: disable CodeReuse/ActiveRecord
identity.update(identity_params)
end
def identity_attributes
[:provider, :extern_uid]
end
+
+ def provider_attributes
+ [:provider]
+ end
+
+ def provider_params
+ identity_params.slice(*provider_attributes)
+ end
end
end