From d279a49cb2af9e0a237d8b4e8c7ad8e78623e23e Mon Sep 17 00:00:00 2001 From: Vins Date: Thu, 23 May 2024 00:26:44 +0200 Subject: [PATCH] Password regex accept _ and - --- src/app/api/customer/AuthController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/customer/AuthController.ts b/src/app/api/customer/AuthController.ts index cbcdf01f..175806a8 100644 --- a/src/app/api/customer/AuthController.ts +++ b/src/app/api/customer/AuthController.ts @@ -139,7 +139,7 @@ export default class AuthController extends ApiController { 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(password)) { this.httpBadRequest(response, "Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"); return;