Esempio n. 1
0
        /// <summary>
        /// updates the database with new password hash
        /// </summary>
        /// <param name="password">The new password</param>
        public async Task ChangeUserHash(string password, string username)
        {
            try
            {
                var result = await App.Repository.UsernameAndHash.GetUsernameAndHash(username);

                result.PasswordHash = SwatIncCrypto.SwatIncSecurityCreateHashSHA512(password);
                var save = await App.Repository.UsernameAndHash.UpsertAsync(result);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
 private string HashPassword(string password)
 {
     return(SwatIncCrypto.SwatIncSecurityCreateHashSHA512(password));
 }