4 ms·
My practice on this is to store the user-provided case, but do case insensitive lookups. This means that you send emails to the case-sensitive address original
by adamcharnock 2y ago
My practice on this is to store the user-provided case, but do case insensitive lookups.
This means that you send emails to the case-sensitive address originally entered, but the user is free to login case insensitively.
The downside is that you cannot have two distinct users with emails that only differ in their case. But I feel rather OK about that.
- ikety 2y agoSeems like the optimal solution to me
- nh2 2y agoYes, this is also what we do. It also allows adding exceptions, in case a customer shows up where you do need to support two users that differ only in casing.
- giovannibonetti 2y agoFor applications storing user data on Postgres, the citext (case-insensitive text) type does just that. https://www.postgresql.org/docs/current/citext.html https://www.postgresql.org/docs/current/citext.html