Compare commits

...

2 Commits

Author SHA1 Message Date
Amit Salunke f6ca709225 Merge pull request 'fix(auth): disallow emojis in password' (#41) from fix/disallow-emoji-in-password into main
Reviewed-on: https://10.10.0.4/AcuPedia/acupedia-store-ui/pulls/41
Reviewed-by: Amit Salunke <amit@noreply.localhost>
2026-10-09 04:57:12 +00:00
ShivaniKhaire 9218d038ae fix(auth): disallow emojis in password 2026-10-08 16:44:57 +05:30
1 changed files with 7 additions and 1 deletions

View File

@ -383,11 +383,17 @@ export default function App() {
setAuthLoading(false); setAuthLoading(false);
return; return;
} }
if (!/[^A-Za-z0-9\s]/.test(authPassword)) { if (/\p{Extended_Pictographic}/u.test(authPassword)) {
setAuthError('Password must not contain emojis.');
setAuthLoading(false);
return;
}
if (!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]/.test(authPassword)) {
setAuthError('Password must contain at least one special character.'); setAuthError('Password must contain at least one special character.');
setAuthLoading(false); setAuthLoading(false);
return; return;
} }
} }
const fullPhone = authPhone ? `${authDialCode}${authPhone}` : undefined; const fullPhone = authPhone ? `${authDialCode}${authPhone}` : undefined;