public async Task<ActionResult> ResetPassword(ResetPasswordViewModel model) { if (ModelState.IsValid) { var result = await UserManager.ResetPasswordAsync(model.UserId, model.Token, model.Password); if (result.Succeeded) { var resultSignIn = await SignInManager.PasswordSignInAsync(model.Email, model.Password, false, shouldLockout: false); var user = await UserManager.FindByNameAsync(model.Email); PersonPrimaryInfo ppi = DoLoginInitialization(user); if (ppi.PromptContactInformationUpdate) { return RedirectToAction("UpdateAccountInfo", "UserAccountSettingsContact"); } else { return RedirectToLocal(null); } } //"The password that you entered (" + model.Password + ") did not meet the password guidelines. <br/> " + TempData["ErrorAlertCustom"] = String.Join("<br/>", result.Errors.ToArray()); //else //{ // TempData["ErrorAlertCustom"] = @"Please try to reset password again."; // return View("ForgotPassword"); //} } return View(model); }
public ActionResult ResetPassword(string userId, string code) { ResetPasswordViewModel model = new ResetPasswordViewModel(); model.Token = code; model.UserId = userId; return View(model); }