Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2018-12-08 17:12:50 +0300
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2019-01-23 22:42:16 +0300
commit104c8b890dbca25a0d08b2567d003f02953a0fc1 (patch)
tree65b834c80c0794e54465f1ec4a8a1f9c682961c8 /lib
parent768475bd78420b6ca023c1322bc13c336d688056 (diff)
Backport EE GroupSAML origin verification changes
Diffstat (limited to 'lib')
-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