Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

How To: Use case insensitive emails

tyrande edited this page · 5 revisions
Clone this wiki locally

As of Devise 1.2.rc (see https://github.com/plataformatec/devise/pull/670), you can make your devise users' emails case-insensitive by changing config/initializers/devise.rb to use:

...
config.case_insensitive_keys = [:email]
...

This works for forgot password, sign up, sign in, etc.

Replace :email with the authentication key that you use.

If you need to find a user (for example in a custom sessions_controller), note that User.find_by_email(params[:email]) is case sensitive. Use User.find_for_authentication(:email => params[:email]) instead.

Something went wrong with that request. Please try again.