diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-12-08 17:12:50 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2019-01-23 22:42:16 +0300 |
commit | 104c8b890dbca25a0d08b2567d003f02953a0fc1 (patch) | |
tree | 65b834c80c0794e54465f1ec4a8a1f9c682961c8 /lib/gitlab/auth | |
parent | 768475bd78420b6ca023c1322bc13c336d688056 (diff) |
Backport EE GroupSAML origin verification changes
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r-- | lib/gitlab/auth/omniauth_identity_linker_base.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/auth/omniauth_identity_linker_base.rb b/lib/gitlab/auth/omniauth_identity_linker_base.rb index 253445570f2..c620fc5d6bd 100644 --- a/lib/gitlab/auth/omniauth_identity_linker_base.rb +++ b/lib/gitlab/auth/omniauth_identity_linker_base.rb @@ -12,7 +12,7 @@ module Gitlab end def link - save if identity.new_record? + save if unlinked? end def changed? @@ -35,6 +35,10 @@ module Gitlab @changed = identity.save end + def unlinked? + identity.new_record? + end + # rubocop: disable CodeReuse/ActiveRecord def identity @identity ||= current_user.identities |