Skip to content

Password configuration doesnt match #204

@marcuscfarias

Description

@marcuscfarias

Hey, I am creating this issue because I notice that the .Matches() extension doesnt work properly. You can notice that I have 3 configs in my password and the display only shows the first one and duplicated.

internal sealed class CreateUserRequestValidator : AbstractValidator<CreateUserRequest>
{
    public CreateUserRequestValidator()
    {
        RuleFor(x => x.Email)
            .NotEmpty()
            .EmailAddress()
            .MaximumLength(UserConsts.EmailMaxLength);

        RuleFor(x => x.Password)
            .NotEmpty()
            .MinimumLength(UserConsts.PasswordMinLength)
            .MaximumLength(UserConsts.PasswordHashMaxLength)
            .Matches("[a-z]").WithMessage("'Password' must contain at least one lowercase letter.")
            .Matches("[A-Z]").WithMessage("'Password' must contain at least one uppercase letter.")
            .Matches("[0-9]").WithMessage("'Password' must contain at least one digit.");

        RuleFor(x => x.FirstName)
            .NotEmpty()
            .MaximumLength(UserConsts.FirstNameMaxLength);

        RuleFor(x => x.LastName)
            .NotEmpty()
            .MaximumLength(UserConsts.LastNameMaxLength);
    }
}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions