pow icon indicating copy to clipboard operation
pow copied to clipboard

Maintain case when storing emails

Open ghost opened this issue 2 years ago • 2 comments

When I register with an email with upper case letters, they are converted to lowercase.

This is happening here

I want to maintain the upper case letters. Is there a simple way to allow for this?

ghost avatar Feb 23 '23 13:02 ghost

There's no way to do it now, but I could make it configurable. It's important to note that the user id MUST be case insensitive, hence why it gets lowercased by default: https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#user-ids

There's no easy way to ensure the Ecto field/column is case insensitive, while not limiting the underlying database. And I wonder if making the normalization function configurable is the right approach. Why do you want it to maintain the case?

danschultzer avatar Feb 23 '23 20:02 danschultzer

I have some users in my application who type their emails using uppercase letters. They complained about seeing their emails modified within the app.

More importantly though, from RFC 5321, section 2.3.11, the part before the "@" could be case-sensitive, since it is entirely under the control of the host system. This basically means that in rare cases, email delivery will fail for emails that needed to have upper case letters, and in my app I do send emails

ghost avatar Feb 24 '23 10:02 ghost