find_by_username_or_email casing


(Randall Koutnik) #1

Can the email addresses stored be lowercased? We just got Discourse up and running and attempted to make someone an admin but couldn’t find them:

=> guy = User.find_by_username_or_email('pants@gmail.com')
    => nil
=> guy = User.find_by_username_or_email('Pants@gmail.com')
    => We got 'em

OAuth2 Basic Support
(Jacob) #2

Email addresses can be case sensitive, I believe it’s like that by design.


(Randall Koutnik) #3

In practice though, no widely used mail systems distinguish different addresses based on case.


(Jacob) #4

Yes, exactly. Re-read that.


(Jeff Atwood) #5

This is the way the spec works… the left part has to be case sensitive, but the domains are not.

specifically

An email address such as John.Smith@example.com is made up of a local part, an @ sign, then a domain part. The domain part is not case-sensitive, but local-parts normally are.


(Jeff Atwood) #6

We decided to remove case sensitivity in emails , this is on @neil’s list to complete for V1.


(Randall Koutnik) #7

Vindication!

Also, thanks for keeping me updated.


(Neil Lalonde) #8

Email is now case insensitive. Vindication complete!