From 5bab113a244c7e1616f159ed0c6b4d27448df8e0 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Thu, 8 Oct 2026 16:54:04 +0530 Subject: [PATCH] fix(auth): disallow emojis in password --- src/features/auth/components/SignUpForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/auth/components/SignUpForm.tsx b/src/features/auth/components/SignUpForm.tsx index fbe8f69..0e204d5 100644 --- a/src/features/auth/components/SignUpForm.tsx +++ b/src/features/auth/components/SignUpForm.tsx @@ -72,11 +72,15 @@ export default function SignUpForm() { } else if (!/[0-9]/.test(password)) { setPasswordError("Password must contain at least one number (0-9)"); hasError = true; - } else if (!/[^A-Za-z0-9\s]/.test(password)) { + } else if (/\p{Extended_Pictographic}/u.test(password)) { + setPasswordError("Password must not contain emojis"); + hasError = true; + } else if (!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]/.test(password)) { setPasswordError("Password must contain at least one special character (!@#$)"); hasError = true; } + if (!confirmPassword) { setConfirmPasswordError("Please confirm your password"); hasError = true;