Password regex accept _ and -

This commit is contained in:
Vins 2024-05-23 00:26:51 +02:00
parent 274c285aa8
commit 724b29f944

View File

@ -118,7 +118,7 @@ export default function Login() {
return;
}
const passwordRegex = new RegExp(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d@$!%*?&]{8,}$/);
const passwordRegex = new RegExp(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d@$!%*?&_\\-]{8,}$/);
if (!passwordRegex.test(values["password"])) {
setValidationErrors([
{