From 33c954f6af108491463f911f338657069348d739 Mon Sep 17 00:00:00 2001 From: Soham Sen Date: Wed, 8 Nov 2023 09:02:11 -0800 Subject: [PATCH] Use better email regex --- src/lib/server/validate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/server/validate.ts b/src/lib/server/validate.ts index a5d9c9c..4c4bceb 100644 --- a/src/lib/server/validate.ts +++ b/src/lib/server/validate.ts @@ -1,4 +1,4 @@ -const emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g; +const emailRegex = /^([\w%+-]+\.)*[\w%+-]+@([A-Z0-9-]+\.)+[A-Z0-9-]{2,}$/i; const passwordLength = 8; const nameLength = 50; const usernameLength = 50;