public IActionResult ResetPassword(ResetPasswordViewModel model) { model.ResetID = TempData["ResetID"].ToString(); model.UserID = Convert.ToInt32(TempData["UserID"]); if (_context.RetrieveResetIDFromDB(model.ResetID)) { _context.ResetPassword(model); ViewBag.Message = "Reset password successful."; _context.LogAction("Forgot Password", "User successfully reset password.", _context.GetUser(model.UserID)); } else { ViewBag.Message = "Password reset failed, please try again."; } return(View()); }