Commit 3594a67d authored by Douwe Maan's avatar Douwe Maan

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
parents 905d3ed4 4e2ddad2
...@@ -64,6 +64,8 @@ module Gitlab ...@@ -64,6 +64,8 @@ module Gitlab
protected protected
def add_or_update_user_identities def add_or_update_user_identities
return unless gl_user
# 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 = gl_user.identities.find { |identity| identity.provider == auth_hash.provider }
......
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