diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-04-11 10:16:15 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-04-11 10:16:15 -0500 |
commit | 12e6084667f8750c263b4a2e324e9a283697b52e (patch) | |
tree | 20b9d57824dbafbcbb346c1a1566fbee2663165f /lib | |
parent | 4087bd16e8e083550d306fd0c90d2a892b8577bf (diff) | |
download | gitlab-ce-12e6084667f8750c263b4a2e324e9a283697b52e.tar.gz |
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.rb | 12 |
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 |