Added regex in password field
This commit is contained in:
@@ -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)(?=.*?[#?_!@$%^&*-])");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user