Пример #1
0
 public virtual void RegenerateEmailVerificationToken()
 {
     if (IsEmailVerified)
     {
         throw new InvalidOperationException("Unable to regenerate email verification because email has already been verified.");
     }
     EmailVerificationToken = SecureToken.Create();
 }
Пример #2
0
 public static User Create(string email, string password)
 {
     return(new User
     {
         Email = (email ?? string.Empty).Trim().ToLower(),
         Firstname = string.Empty,
         Lastname = string.Empty,
         Password = Password.Create(password ?? string.Empty, (email ?? string.Empty).Trim().ToLower()),
         Created = DateTime.Now,
         LastLogon = DateTime.Now,
         EmailVerificationToken = SecureToken.Create(),
         ForgottenPasswordAssistanceToken = null,
         ForgottenPasswordAssistanceTokenIssued = null,
         ForgottenPasswordAssistanceTokenUsed = null,
         RecentlyFailedLogonAttempts = 0,
         LastFailedLogonAttempt = null,
         Roles = UserRoles.Import | UserRoles.Export
     });
 }
Пример #3
0
 public virtual void GenerateForgottenPasswordAssistanceToken()
 {
     ForgottenPasswordAssistanceToken       = SecureToken.Create();
     ForgottenPasswordAssistanceTokenIssued = DateTime.Now;
     ForgottenPasswordAssistanceTokenUsed   = null;
 }