Exemplo n.º 1
0
 public ActionResult Index(ResetPassword resetPassword)
 {
     if (!ModelState.IsValid)
     {
         return(View());
     }
     if (!user.ResetPassword(resetPassword, int.Parse(Session["UserId"].ToString())))
     {
         Logging.loggError($"Old password is incorrect for user Id = {Session["UserId"]}, please try again");
         ModelState.AddModelError("OldPassword", "Old Password is Incorrect");
         return(View());
     }
     Logging.loggInfo($"Password reset for user Id = {Session["UserId"]}");
     return(Redirect("/HomePage/Dashboard"));
 }