From 0bb85852e2f81babaced5f2d1cb89dccea9f551e Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 22 Oct 2026 11:42:06 +0530 Subject: [PATCH] issue(59):fixed the password validation rejecting emoji as special character --- src/app/login/forgot-password.tsx | 2 +- src/app/profile/change-password.tsx | 2 +- src/features/auth/components/SignUpForm.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/login/forgot-password.tsx b/src/app/login/forgot-password.tsx index 098228b..93180a2 100644 --- a/src/app/login/forgot-password.tsx +++ b/src/app/login/forgot-password.tsx @@ -89,7 +89,7 @@ export default function ForgotPasswordScreen() { } else if (!/[0-9]/.test(newPassword)) { setPasswordError("Must contain at least one number"); hasError = true; - } else if (!/[^A-Za-z0-9\s]/.test(newPassword)) { + } else if (!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~`]/.test(newPassword)) { setPasswordError("Must contain at least one special character"); hasError = true; } diff --git a/src/app/profile/change-password.tsx b/src/app/profile/change-password.tsx index 5d82ba6..806b41e 100644 --- a/src/app/profile/change-password.tsx +++ b/src/app/profile/change-password.tsx @@ -54,7 +54,7 @@ export default function ChangePasswordScreen() { } else if (!/[0-9]/.test(newPassword)) { setNewError("Must contain at least one number"); hasError = true; - } else if (!/[^A-Za-z0-9\s]/.test(newPassword)) { + } else if (!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~`]/.test(newPassword)) { setNewError("Must contain at least one special character"); hasError = true; } diff --git a/src/features/auth/components/SignUpForm.tsx b/src/features/auth/components/SignUpForm.tsx index fbe8f69..bc428c0 100644 --- a/src/features/auth/components/SignUpForm.tsx +++ b/src/features/auth/components/SignUpForm.tsx @@ -72,7 +72,7 @@ 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 (!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~`]/.test(password)) { setPasswordError("Password must contain at least one special character (!@#$)"); hasError = true; }