Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
74 stars 32 forks source link

Normalize emails before storage and compare them in lower case #132

Closed happy-river closed 4 years ago

happy-river commented 4 years ago

Use email-validator to parse emails and convert them to a consistent format for storage, which removes ambiguity since Unicode made it possible to have multiple equivalent forms of the same email address. See the description of email-validator for a more detailed explanation.

Since the username part of an email address is permitted to be case sensitive by RFC 5321, but in practice rarely is, store the email as the user gave it to us (after normalization by email_validator) and use that version for sending emails, but do all comparisons of and searches on email addresses in lower case.