4 ms·
The best way to validate an email address: Send an email that they need to click on (or an email with a code they need to enter), OR ask the OAuth provider wit
by buro9 10y ago
The best way to validate an email address:
Send an email that they need to click on (or an email with a code they need to enter), OR ask the OAuth provider with authority for it to validate it (i.e. Google Oauth for Google addresses, Windows Live for Microsoft Accounts, etc).
The best way to identify someone with an email address:
Store a canonical version of their email address alongside the users email. Use the canonical version when signing-in/identifying and the raw version originally supplied to send email.
This is the only way to not have duplicate accounts for firstlast@googlemail.com vs first.last@googlemail.com vs first.last@gmail.com .
The canonical email is always lowercase, no dots, no + part, no prefix or suffix columns, known domain aliases are normalised to the most common alias (googlemail.com > gmail.com).
I wrote a SQL canonical email func recently (in preparation for Persona shut-down) if anyone is interested: https://github.com/microcosm-cc/microcosm/blob/master/db/migrations/20160831112556_canonical_email.sql https://github.com/microcosm-cc/microcosm/blob/master/db/mig...
- cimnine 10y agoJust make sure the (canonical) email address is not the primary identifier for the user, as email addresses may change over time.
- justinlardinois 10y ago> This is the only way to not have duplicate accounts for firstlast@googlemail.com vs first.last@googlemail.com vs first.last@gmail.com . Periods being optional in usernames is something that Gmail started, not a universal rule or part of the specification. Are you going to build into your system all the possible variations for every email provider?
- buro9 10y ago> Are you going to build into your system all the possible variations for every email provider? I've analysed my user database and am only doing the large providers for which I have high confidence.