summaryrefslogtreecommitdiff
path: root/lib/gitlab/auth
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2018-12-08 14:12:50 +0000
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2019-01-23 19:42:16 +0000
commit104c8b890dbca25a0d08b2567d003f02953a0fc1 (patch)
tree65b834c80c0794e54465f1ec4a8a1f9c682961c8 /lib/gitlab/auth
parent768475bd78420b6ca023c1322bc13c336d688056 (diff)
downloadgitlab-ce-104c8b890dbca25a0d08b2567d003f02953a0fc1.tar.gz
Backport EE GroupSAML origin verification changes
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r--lib/gitlab/auth/omniauth_identity_linker_base.rb6
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