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

This commit is contained in:
Tiago Botelho 2017-10-05 11:53:54 +01:00
parent d55216c092
commit 4e2ddad2bb
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 }