internal AuthenticationStatus ResetPassword(int requestId, string password) { try { if (PasswordResetRequest == null) { return(AuthenticationStatus.ResetRequestNotFound); } else if (PasswordResetRequest.RequestId != requestId) { return(AuthenticationStatus.Failed); } else if ((DateTime.UtcNow - PasswordResetRequest.RequestTime).TotalHours > Configuration.AllowedPasswordResetHoursSkew) { return(AuthenticationStatus.RequestIsTooOld); } PasswordHash = password.GetPasswordHash(); return(AuthenticationStatus.Success); } finally { PasswordResetRequest = null; } }
internal int RequestPasswordReset() { PasswordResetRequest = new PasswordResetRequest(); return(PasswordResetRequest.RequestId); }