Merge branch '38801-add-or-update-identities-should-only-work-if-gl-user-exists' into 'master'

Only add identities to a user if we find one in Gitlab::OAuth::User.

Closes #38801

See merge request gitlab-org/gitlab-ce!14702
This commit is contained in:
Douwe Maan 2017-10-05 12:11:19 +00:00
commit 3594a67d30
1 changed files with 2 additions and 0 deletions

View File

@ -64,6 +64,8 @@ module Gitlab
protected
def add_or_update_user_identities
return unless gl_user
# 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 }