DRY find method to find Gitlab user

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