From b9b65b8d4e15bc7eec521b27f385ed62fb08d23f Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 24 Feb 2012 14:35:44 +0000 Subject: [PATCH] Ensure LDAP provided email is always compared case-insensitively. LDAP databases may store email addresses in mixed case so ensure we only work with a lower case version to avoid missing a valid account after LDAP login. Signed-off-by: Pat Thoyts --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 5caa7451..b85ee808 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,7 +73,7 @@ class User < ActiveRecord::Base def self.find_for_ldap_auth(omniauth_info) name = omniauth_info.name - email = omniauth_info.email + email = omniauth_info.email.downcase if @user = User.find_by_email(email) @user