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('')
    => nil
=> guy = User.find_by_username_or_email('')
    => 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.


An email address such as 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


Also, thanks for keeping me updated.

(Neil Lalonde) #8

Email is now case insensitive. Vindication complete!

(system) #9

(Alan Tan) #10