chore: use min_passwd_length with attribute
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-02-06 21:07:01 +01:00
parent f7ab994ddb
commit 90553d9ae9
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -5,9 +5,12 @@ namespace pwt_0x01_ng.Models
{
public class RegisterViewModel
{
private string min_passwd_length_err_msg = "minimum password length is "+ config.min_passwd_length;
[Required]
public string username {get; set;}
[Required]
[RegularExpression(@"^.{{min_passwd_length},}$")]
public string password {get; set;}
[Required]
[Compare(nameof(password), ErrorMessage = "Passwords don't match.")]