public async Task<bool> ResetPasswordAsync(ResetPasswordDto model)
        {
            var user = await _userRepository.FindUserByAsync(new List<Filter>()
            {
                new Filter("Email", model.Email),
                new Filter("ResetPasswordToken", model.Code),
                new Filter("Enabled", true)
            });

            if (user == null) return false;

            user.Password = PasswordHash.CreatePasswordHash(model.Password);
            user.ResetPasswordToken = null;
            user.Sid = PasswordHash.GenerateToken();
            await _userRepository.SaveChangesAsync();
            return true;
        }
 public async Task<ActionResult> ResetPassword(ResetPasswordDto model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     if (await _userProvider.ResetPasswordAsync(model))
     {
         return View("ResetPasswordConfirmation");
     }
     else
     {
         return View("Errors/Error");
     }
 }