Example #1
0
 public async Task<ActionResult> ResetPassword(ResetPasswordViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     var user = await UserManager.FindByNameAsync(model.Email, cancellationToken: Context.RequestAborted);
     if (user == null)
     {
         // Don't reveal that the user does not exist
         return RedirectToAction("ResetPasswordConfirmation", "Account");
     }
     var result = await UserManager.ResetPasswordAsync(user, model.Code, model.Password, cancellationToken: Context.RequestAborted);
     if (result.Succeeded)
     {
         return RedirectToAction("ResetPasswordConfirmation", "Account");
     }
     AddErrors(result);
     return View();
 }
Example #2
0
 public ActionResult ResetPassword(string code)
 {
     //TODO: Fix this?
     var resetPasswordViewModel = new ResetPasswordViewModel() { Code = code };
     return code == null ? View("Error") : View(resetPasswordViewModel);
 }