Commit 3254709f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'dblessing_saml_user_identity_fix' into 'master'

Remove unncessary group SAML identity assignment

See merge request gitlab-org/gitlab!61921
parents 8b8c2810 7c91362d
---
title: Remove unncessary group SAML identity assignment
merge_request: 61921
author:
type: fixed
...@@ -84,10 +84,10 @@ module Gitlab ...@@ -84,10 +84,10 @@ module Gitlab
override :add_or_update_user_identities override :add_or_update_user_identities
def add_or_update_user_identities def add_or_update_user_identities
return unless gl_user return unless gl_user
return if self.identity # extern_uid hasn't changed
identity = self.identity
# find_or_initialize_by doesn't update `gl_user.identities`, and isn't autosaved. # find_or_initialize_by doesn't update `gl_user.identities`, and isn't autosaved.
identity ||= gl_user.identities.find { |identity| identity.provider == auth_hash.provider && identity.saml_provider_id == @saml_provider.id } identity = gl_user.identities.find { |identity| identity.provider == auth_hash.provider && identity.saml_provider_id == @saml_provider.id }
identity ||= gl_user.identities.build(provider: auth_hash.provider, saml_provider: @saml_provider) identity ||= gl_user.identities.build(provider: auth_hash.provider, saml_provider: @saml_provider)
identity.extern_uid = auth_hash.uid identity.extern_uid = auth_hash.uid
......
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