diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-30 16:40:31 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-30 16:41:07 -0500 |
commit | 04bb8fe9942f8558124f00e8cdfb50ef7059bf9e (patch) | |
tree | 2acd5291f542104427f6d61281eaff889e10ec71 /lib | |
parent | 8039b9c3c6caedc19e0e44d086a007e8975134b7 (diff) | |
download | gitlab-ce-04bb8fe9942f8558124f00e8cdfb50ef7059bf9e.tar.gz |
Return nil when looking up config for unknown LDAP providerdm-oauth-config-for
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/o_auth/provider.rb | 6 |
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 |