core: add migration service

This commit is contained in:
undefined committed 2024-07-03 18:09:48 +08:00
1 parent 9e4643c1bf
commit 70872fe931
6 files changed
+99 -50

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ declare module '@hydrooj/framework' {
interface UserModel extends User { }
}
function handleMailLower(mail: string) {
export function handleMailLower(mail: string) {
const [n, d] = mail.trim().toLowerCase().split('@');
const [name] = n.split('+');
return `${name.replace(/\./g, '')}@${d === 'googlemail.com' ? 'gmail.com' : d}`;