public static bool UpdatePassword(User user)
 {
     if (AuthenticationService.ValidateUser(out _, out User userex, user.UserName, user.Password))
     {
         userex.Password = EncryptionService.CypherText(user.Password1, userex.PasswordFormat, userex.PasswordHashAlgorithm, userex.PasswordSalt);
         try
         {
             Set(userex);
             return(true);
         }
         catch (SqlException)
         {
             return(false);
         }
     }
     return(false);
 }
Exemple #2
0
 private static bool ValidatePassword(User user, string password)
 {
     return(user.Password.Equals(EncryptionService.CypherText(password, user.PasswordFormat, user.PasswordHashAlgorithm, user.PasswordSalt)));
 }