From 450fa55f1cdb3111bc3fa3ba2b3baf73d841c8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sat, 27 Apr 2024 18:18:47 +0200 Subject: [PATCH] LDAP: Ignore case when searching for account by username --- app/models/concerns/user/ldap_authenticable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/user/ldap_authenticable.rb b/app/models/concerns/user/ldap_authenticable.rb index 180df9d3101ebb..1dcbbe094c10f3 100644 --- a/app/models/concerns/user/ldap_authenticable.rb +++ b/app/models/concerns/user/ldap_authenticable.rb @@ -22,7 +22,7 @@ def ldap_get_user(attributes = {}) safe_username = safe_username.gsub(keys, replacement) end - resource = joins(:account).find_by(accounts: { username: safe_username }) + resource = joins(:account).find_by('accounts.username ILIKE ?', safe_username) if resource.blank? resource = new(