Commit 91e7692b authored by Jakub Jirutka's avatar Jakub Jirutka

Fix searching by extern_uid for LDAP to be case-insensitive

parent 5e935bfe
......@@ -83,8 +83,13 @@ module Gitlab
private
def find_by_uid_and_provider
find_by_uid(uid)
end
def find_by_uid(uid)
model.where(provider: provider, extern_uid: uid).last
# LDAP distinguished name is case-insensitive
model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last
end
def provider
......
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