public async Task SetUserPasswordAsync(int currentUserId, int userId, string password) { var user = DbSet.Find(userId); string original = _entitySerializer.Serialize(user); user.PasswordHash = _passwordHasher.HashPassword(password); await UpdateSaveAsync(currentUserId, user, original); }
public async Task SetUserPasswordAsync(int currentUserId, int userId, string password) { var user = DbSet.Find(userId); if (user.IsSystemUser) { throw new GraException("Cannot set a password for the System User."); } string original = _entitySerializer.Serialize(user); user.PasswordHash = _passwordHasher.HashPassword(password); await UpdateSaveAsync(currentUserId, user, original); }