Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Devise, Email Case Insensitivity

Tags:

I'm using Devise with login credentials: email/password - no usernames

I just noticed that the login process is case sensitive for emails. so if you register with [email protected], and then try to log in with [email protected] you get an error. Very confusing.

How can I make devise log people in with their email/password, and the email being case insensitive?

like image 940
AnApprentice Avatar asked Nov 10 '10 19:11

AnApprentice


1 Answers

You can easily fix the issue like below.

# config/initializers/devise.rb
Devise.setup do |config|
  config.case_insensitive_keys = [:email, :username]
end
like image 171
heyjinkim Avatar answered Sep 26 '22 08:09

heyjinkim