mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Revert "No longer remove dots from normalized emails"
This reverts commit 8b3a94928a.
This commit is contained in:
parent
668ab68ebb
commit
d58dda3ed8
@ -373,6 +373,8 @@ export function normalizeEmail(email: string): string {
|
||||
throw new TypeError('normalize-email expects a string');
|
||||
}
|
||||
|
||||
const removeDotsDomains = ['gmail.com', 'googlemail.com', 'live.com'];
|
||||
|
||||
const emailLower = email.trim().toLowerCase();
|
||||
const emailParts = emailLower.split(/@/);
|
||||
|
||||
@ -382,6 +384,10 @@ export function normalizeEmail(email: string): string {
|
||||
|
||||
let [username, domain] = emailParts;
|
||||
|
||||
if (removeDotsDomains.includes(domain)) {
|
||||
username = username.replace(/\.+/g, '');
|
||||
}
|
||||
|
||||
return `${username}@${domain}`;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user