Commit 325b6636 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove special cases for the 'ldap' provider

parent 896ea248
...@@ -27,8 +27,6 @@ module Gitlab ...@@ -27,8 +27,6 @@ module Gitlab
def initialize(provider) def initialize(provider)
if self.class.valid_provider?(provider) if self.class.valid_provider?(provider)
@provider = provider @provider = provider
elsif provider == 'ldap'
@provider = self.class.providers.first
else else
self.class.invalid_provider(provider) self.class.invalid_provider(provider)
end end
......
...@@ -13,7 +13,7 @@ module Gitlab ...@@ -13,7 +13,7 @@ module Gitlab
def find_by_uid_and_provider(uid, provider) def find_by_uid_and_provider(uid, provider)
# LDAP distinguished name is case-insensitive # LDAP distinguished name is case-insensitive
identity = ::Identity. identity = ::Identity.
where(provider: [provider, :ldap]). where(provider: provider).
where('lower(extern_uid) = ?', uid.downcase).last where('lower(extern_uid) = ?', uid.downcase).last
identity && identity.user identity && identity.user
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment