public IActionResult ResetNewPassword(string userId, string hash)
        {
            ApplicationUser appUser = _userManager.Users.FirstOrDefault(x => x.Id == userId);

            if (appUser == null)
            {
                return(NotFound());
            }

            string savedHash = SHA256.Create().FromString(appUser.Id.ToString());

            if (savedHash == hash)
            {
                var vm = new ResetPasswordNewPasswordViewModel
                {
                    Hash   = hash,
                    UserId = userId
                };
                return(View(vm));
            }
            else
            {
                return(NotFound());
            }
        }
        public async Task <IActionResult> ResetNewPassword(ResetPasswordNewPasswordViewModel vm)
        {
            if (ModelState.IsValid)
            {
                if (vm.Password1 != vm.Password2)
                {
                    ModelState.AddModelError("PasswordNotMatch", "Las contraseñas no coinciden");
                    return(View(vm));
                }
                var user = _userManager.Users.FirstOrDefault(s => s.Id == vm.UserId);

                if (user == null)
                {
                    ModelState.AddModelError("UserNotValid", "La operación no fue autorizada");
                    return(View(vm));
                }
                else
                {
                    await _userManager.RemovePasswordAsync(user);

                    await _userManager.AddPasswordAsync(user, vm.Password1);

                    return(RedirectToAction("Login"));
                }
            }
            return(View(vm));
        }