diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-04-11 18:16:15 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-04-11 18:16:15 +0300 |
commit | 12e6084667f8750c263b4a2e324e9a283697b52e (patch) | |
tree | 20b9d57824dbafbcbb346c1a1566fbee2663165f /lib/gitlab/o_auth/user.rb | |
parent | 4087bd16e8e083550d306fd0c90d2a892b8577bf (diff) |
Allow `external_providers` for Omniauth to be defined to mark these users as external
Diffstat (limited to 'lib/gitlab/o_auth/user.rb')
-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 |