From e3eb8577e1d738f9928bfd9586da89cc095368c3 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Sat, 5 Jul 2025 18:42:19 -0700 Subject: [PATCH] Revert dot email normalization --- apps/backend/src/lib/emails.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/backend/src/lib/emails.tsx b/apps/backend/src/lib/emails.tsx index 7c54691eb..f1db58d66 100644 --- a/apps/backend/src/lib/emails.tsx +++ b/apps/backend/src/lib/emails.tsx @@ -373,7 +373,6 @@ 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(/@/); @@ -384,16 +383,12 @@ export function normalizeEmail(email: string): string { let [username, domain] = emailParts; - if (removeDotsDomains.includes(domain)) { - username = username.replace(/\.+/g, ''); - } - return `${username}@${domain}`; } import.meta.vitest?.test('normalizeEmail(...)', async ({ expect }) => { - expect(normalizeEmail('Example.Test@gmail.com')).toBe('exampletest@gmail.com'); - expect(normalizeEmail('Example.Test+123@gmail.com')).toBe('exampletest+123@gmail.com'); + expect(normalizeEmail('Example.Test@gmail.com')).toBe('example.test@gmail.com'); + expect(normalizeEmail('Example.Test+123@gmail.com')).toBe('example.test+123@gmail.com'); expect(normalizeEmail('exampletest@gmail.com')).toBe('exampletest@gmail.com'); expect(normalizeEmail('EXAMPLETEST@gmail.com')).toBe('exampletest@gmail.com');