DRY find method to find Gitlab user

parent 410d6e30
...@@ -29,10 +29,8 @@ module Gitlab ...@@ -29,10 +29,8 @@ module Gitlab
end end
def find_by_uid_and_provider def find_by_uid_and_provider
# LDAP distinguished name is case-insensitive self.class.find_by_uid_and_provider(
model. auth_hash.provider, auth_hash.uid.downcase)
where(provider: [auth_hash.provider, :ldap]).
where('lower(extern_uid) = ?', auth_hash.uid.downcase).last
end end
def find_by_email def find_by_email
......
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