29 lines
1.6 KiB
C#
29 lines
1.6 KiB
C#
using PrivaPub.ClientModels.Resources;
|
|
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace PrivaPub.ClientModels
|
|
{
|
|
public class NewPasswordForm
|
|
{
|
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
PasswordPropertyText(true),
|
|
Display(Name = "NewPassword", ResourceType = typeof(FieldsNameResource)),
|
|
StringLength(Constants.MaxPasswordLength, MinimumLength = Constants.MinPasswordLength, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
RegularExpression(Constants.PasswordRegex, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
public string NewPassword { get; set; }
|
|
|
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
PasswordPropertyText(true),
|
|
Compare(nameof(NewPassword), ErrorMessageResourceName = "ComparePasswords", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
Display(Name = "NewPasswordConfirmation", ResourceType = typeof(FieldsNameResource))]
|
|
public string RepeatedPassword { get; set; }
|
|
|
|
[Display(Name = "RecoveryCode", ResourceType = typeof(FieldsNameResource)),
|
|
Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
public string RecoveryCode { get; set; }
|
|
}
|
|
} |