Added regex in password field

This commit is contained in:
2026-05-18 15:26:24 +01:00
parent 76cbe90521
commit e1c505e7a1
@@ -43,9 +43,8 @@ public class CreateUserDtoValidator : Validator<CreateUserDto>
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)(?=.*?[#?_!@$%^&*-])");
}
}