mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-22 17:28:43 +00:00
Basic re-auth framework in place
This commit is contained in:
11
server/Models/ViewModels/CredentialsViewModelValidator.cs
Normal file
11
server/Models/ViewModels/CredentialsViewModelValidator.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace PodNoms.Api.Models.ViewModels {
|
||||
public class CredentialsViewModelValidator : AbstractValidator<CredentialsViewModel> {
|
||||
public CredentialsViewModelValidator() {
|
||||
RuleFor(vm => vm.UserName).NotEmpty().WithMessage("Username cannot be empty");
|
||||
RuleFor(vm => vm.Password).NotEmpty().WithMessage("Password cannot be empty");
|
||||
RuleFor(vm => vm.Password).Length(6, 12).WithMessage("Password must be between 6 and 12 characters");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user