authlogic-password-reset-tutorial
authlogic-password-reset-tutorial copied to clipboard
find_by_email is case sensitive
Hi
Just ran into this issue with my own project. Authlogic also does this when looking up an email for login purposes, so we need to do the same on reset:
email = params[:email]
@user = User.where("LOWER(email) = ?", email).first
Otherwise [email protected] will not match [email protected] when doing a reset, even though it does match when doing login / registration duplication check.
The above is the default Authlogic behaviour which can of course be overrided, i.e. you can tell Authlogic to treat emails as case sensitive if you want.
Whoops, email needs a downcase, this won't work otherwise...
Ahh, right...
Do you think you can make a pull request with a fix? Since I have no app using Authlogic right now, I don't know if it's working or not.