diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-06-28 12:25:55 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-06-28 12:25:55 +0300 |
commit | dbd86f00599fb127a9aeaca0a875769d3bd2d83f (patch) | |
tree | b07bbab5307ad59a4fc531ac89b186256813e7a0 /app | |
parent | a80f871a3d9b7ce9de2e1d563eac52ccd12945f4 (diff) | |
parent | 867d810d8a9a0790e6051a96dc0b1fdb883ddbf6 (diff) |
Merge branch 'sh-fix-issue-12303' into 'master'
Backport CE changes for multiple GroupSAML support
See merge request gitlab-org/gitlab-ce!30102
Diffstat (limited to 'app')
-rw-r--r-- | app/services/users/update_service.rb | 10 |
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 |