| | | 1 | | using ArturRios.Util.WebApi.Security.Records; |
| | | 2 | | using FluentValidation; |
| | | 3 | | |
| | | 4 | | namespace ArturRios.Util.WebApi.Security.Validation; |
| | | 5 | | |
| | | 6 | | /// <summary>FluentValidation validator for <see cref="Credentials"/>: requires a valid email and a password of at least |
| | | 7 | | public class CredentialsValidator : AbstractValidator<Credentials> |
| | | 8 | | { |
| | | 9 | | /// <summary>Defines the validation rules for <see cref="Credentials"/>.</summary> |
| | 4 | 10 | | public CredentialsValidator() |
| | 4 | 11 | | { |
| | 4 | 12 | | RuleFor(credentials => credentials.Email).NotEmpty().EmailAddress(); |
| | 4 | 13 | | RuleFor(credentials => credentials.Password).NotEmpty().MinimumLength(8); |
| | 4 | 14 | | } |
| | | 15 | | } |