fix(auth): disallow emojis in password #41

Merged
amit merged 1 commits from fix/disallow-emoji-in-password into main 2026-10-09 04:57:13 +00:00
1 changed files with 7 additions and 1 deletions

View File

@ -331,11 +331,17 @@ export default function App() {
setAuthLoading(false);
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.');
setAuthLoading(false);
return;
}
}
const fullPhone = authPhone ? `${authDialCode}${authPhone}` : undefined;