summaryrefslogtreecommitdiff
path: root/lib/gitlab/o_auth
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-30 16:40:31 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-30 16:41:07 -0500
commit04bb8fe9942f8558124f00e8cdfb50ef7059bf9e (patch)
tree2acd5291f542104427f6d61281eaff889e10ec71 /lib/gitlab/o_auth
parent8039b9c3c6caedc19e0e44d086a007e8975134b7 (diff)
downloadgitlab-ce-04bb8fe9942f8558124f00e8cdfb50ef7059bf9e.tar.gz
Return nil when looking up config for unknown LDAP providerdm-oauth-config-for
Diffstat (limited to 'lib/gitlab/o_auth')
-rw-r--r--lib/gitlab/o_auth/provider.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/o_auth/provider.rb b/lib/gitlab/o_auth/provider.rb
index 9ad7a38d505..ac9d66c836d 100644
--- a/lib/gitlab/o_auth/provider.rb
+++ b/lib/gitlab/o_auth/provider.rb
@@ -22,7 +22,11 @@ module Gitlab
def self.config_for(name)
name = name.to_s
if ldap_provider?(name)
- Gitlab::LDAP::Config.new(name).options
+ if Gitlab::LDAP::Config.valid_provider?(name)
+ Gitlab::LDAP::Config.new(name).options
+ else
+ nil
+ end
else
Gitlab.config.omniauth.providers.find { |provider| provider.name == name }
end