SocialPub/PrivaPub.ClientModels/NewPasswordForm.cs

29 lines
1.6 KiB
C#
Raw Normal View History

2023-02-19 00:43:43 +01:00
using PrivaPub.ClientModels.Resources;
2023-02-18 08:52:17 +01:00
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
2023-02-19 00:43:43 +01:00
namespace PrivaPub.ClientModels
2023-02-18 08:52:17 +01:00
{
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; }
}
}