diff options
author | Drew Blessing <drew@gitlab.com> | 2016-06-16 15:11:09 -0500 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2016-06-22 16:10:55 -0500 |
commit | 938f2b9979e8aae74307571d2c56df3f9b2981f5 (patch) | |
tree | d413a6f5a993e7aee6fe48f4e960b85b35f80037 /lib/gitlab/o_auth | |
parent | 98cede7ebeae9dac994b35b66be6aab14eb932b3 (diff) | |
download | gitlab-ce-938f2b9979e8aae74307571d2c56df3f9b2981f5.tar.gz |
Fix subsequent SAML sign ins
Diffstat (limited to 'lib/gitlab/o_auth')
-rw-r--r-- | lib/gitlab/o_auth/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb index 78f3ecb4cb4..7af75a9cc4c 100644 --- a/lib/gitlab/o_auth/user.rb +++ b/lib/gitlab/o_auth/user.rb @@ -74,7 +74,7 @@ module Gitlab if user # Case when a LDAP user already exists in Gitlab. Add the OAuth identity to existing account. log.info "LDAP account found for user #{user.username}. Building new #{auth_hash.provider} identity." - user.identities.build(extern_uid: auth_hash.uid, provider: auth_hash.provider) + user.identities.find_or_initialize_by(extern_uid: auth_hash.uid, provider: auth_hash.provider) else log.info "No existing LDAP account was found in GitLab. Checking for #{auth_hash.provider} account." user = find_by_uid_and_provider |