From e1c505e7a16c8f44d9e18fd6122cf866c1379ed7 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 18 May 2026 15:26:24 +0100 Subject: [PATCH] Added regex in password field --- BeReadyBackend/Validators/Users/CreateUserDtoValidator.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BeReadyBackend/Validators/Users/CreateUserDtoValidator.cs b/BeReadyBackend/Validators/Users/CreateUserDtoValidator.cs index 4ff6421..d0bbe6f 100644 --- a/BeReadyBackend/Validators/Users/CreateUserDtoValidator.cs +++ b/BeReadyBackend/Validators/Users/CreateUserDtoValidator.cs @@ -43,9 +43,8 @@ public class CreateUserDtoValidator : Validator RuleFor(x => x.Password) .NotEmpty() .WithMessage("Password is required") - .MaximumLength(60) - .WithMessage("Password cannot exceed 60 characters") .MinimumLength(12) - .WithMessage("Password must exceed 12 characters"); + .WithMessage("Password must exceed 12 characters") + .Matches(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*?[#?_!@$%^&*-])"); } } \ No newline at end of file