mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: user: update email normalization (#812)
This commit is contained in:
1 parent
f38cf6e02a
commit
1a981b9bf5
2 files changed
+5
-8
No files matched your search
@@ -36,13 +36,9 @@ const langMap = {
|
||||
Python3: 'py.py3',
|
||||
};
|
||||
function handleMailLower(mail: string) {
|
||||
let data = mail.trim().toLowerCase();
|
||||
if (data.endsWith('@googlemail.com')) data = data.replace('@googlemail.com', '@gmail.com');
|
||||
if (data.endsWith('@gmail.com')) {
|
||||
const [prev] = data.split('@');
|
||||
data = `${prev.replace(/[.+]/g, '')}@gmail.com`;
|
||||
}
|
||||
return data;
|
||||
const [n, d] = mail.trim().toLowerCase().split('@');
|
||||
const [name] = n.split('+');
|
||||
return `${name.replace(/\./g, '')}@${d === 'googlemail.com' ? 'gmail.com' : d}`;
|
||||
}
|
||||
|
||||
export async function run({
|
||||
|
||||
Reference in new issue
Block a user