core: user: update email normalization (#812)

This commit is contained in:
Yang Gao authored and GitHub committed 2024-05-18 21:04:59 +08:00
1 parent f38cf6e02a
commit 1a981b9bf5
2 files changed
+5 -8

No files matched your search

+2 -1
View File
@@ -177,7 +177,8 @@ export class User {
function handleMailLower(mail: string) {
const [n, d] = mail.trim().toLowerCase().split('@');
return `${n.replace(/\./g, '').replace(/\+.$/, '')}@${d === 'googlemail.com' ? 'gmail.com' : d}`;
const [name] = n.split('+');
return `${name.replace(/\./g, '')}@${d === 'googlemail.com' ? 'gmail.com' : d}`;
}
async function initAndCache(udoc: Udoc, dudoc, scope: bigint = PERM.PERM_ALL) {