I’m using postgresql
Devise stores emails in db with downcase:
config.case_insensitive_keys = [ :email ]
But when i login with uppercased email – i got error that email is wrong.
I find solition for this, but this have 1 trouble:
def self.find_for_authentication(conditions = {})
# Allow to log in with case insensitive email
conditions[:email].downcase!
end
1) When I try to logged in with wrong uppercased email I got error and my email with downcase. (logged with AAA@bbb.CCC, got aaa@bbb.ccc, but i need to show AAA@bbb.CCC). How can I change this behaviour ?
Solution was really simple. What you need is just copy params hash and change email in this hash when login, but when user got exception – we just return original hash with entered params