Table of Contents

Class SetPasswordForm

Namespace
NuvTools.Security.Identity.Models.Form
Assembly
NuvTools.Security.Identity.Models.dll

Represents a new password chosen without typing the current one: completing a reset link, or adding a password to an account that signed up through an external provider.

public class SetPasswordForm
Inheritance
SetPasswordForm
Inherited Members

Remarks

The user and the proof that they may set it — the reset token, or the signed-in session — come from the link or the session, never from this form. Password complexity requirements include at least one capital letter, one lowercase letter, and one digit; the identity system's own policy still runs when the password is applied.

Properties

ConfirmNewPassword

Gets or sets the confirmation of the new password.

[Display(Name = "ConfirmNewPassword", ResourceType = typeof(Fields))]
[Required(ErrorMessageResourceName = "XRequired", ErrorMessageResourceType = typeof(Messages))]
[Compare("NewPassword", ErrorMessageResourceName = "XMustBeEqualY", ErrorMessageResourceType = typeof(Messages))]
public virtual string? ConfirmNewPassword { get; set; }

Property Value

string

Remarks

Must match NewPassword exactly.

NewPassword

Gets or sets the new password.

[Display(Name = "NewPassword", ResourceType = typeof(Fields))]
[Required(ErrorMessageResourceName = "XRequired", ErrorMessageResourceType = typeof(Messages))]
[MaxLength(40, ErrorMessageResourceName = "XMustHaveUpToYCharacters", ErrorMessageResourceType = typeof(Messages))]
[MinLength(6, ErrorMessageResourceName = "XMustHaveAtLeastYCharacters", ErrorMessageResourceType = typeof(Messages))]
[PasswordComplexityCapitalLetters(1)]
[PasswordComplexityLowerCaseLetters(1)]
[PasswordComplexityDigits(1)]
public virtual string? NewPassword { get; set; }

Property Value

string