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:
authorPatricio Cano <suprnova32@gmail.com>2016-04-11 18:16:15 +0300
committerPatricio Cano <suprnova32@gmail.com>2016-04-11 18:16:15 +0300
commit12e6084667f8750c263b4a2e324e9a283697b52e (patch)
tree20b9d57824dbafbcbb346c1a1566fbee2663165f /lib
parent4087bd16e8e083550d306fd0c90d2a892b8577bf (diff)
Allow `external_providers` for Omniauth to be defined to mark these users as external
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/o_auth/user.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb
index 832fb08a526..6e099c26d8c 100644
--- a/lib/gitlab/o_auth/user.rb
+++ b/lib/gitlab/o_auth/user.rb
@@ -54,6 +54,14 @@ module Gitlab
@user ||= build_new_user
end
+ unless @user.nil?
+ if external_provider?
+ @user.external = true
+ else
+ @user.external = false
+ end
+ end
+
@user
end
@@ -113,6 +121,10 @@ module Gitlab
end
end
+ def external_provider?
+ Gitlab.config.omniauth.external_providers.include?(auth_hash.provider)
+ end
+
def block_after_signup?
if creating_linked_ldap_user?
ldap_config.block_auto_created_users