public ActionResult ResetPassword(string un, string rt) { var help = new AccountControllerHelpers(UoW, PWS); bool any; using (var db = new UsersContext()) { var userid = help.GetUserId(db, un); //check userid and token matches any = help.GetUserIdAndTokenMatches(db, userid, rt); } if (any) { string newpassword = help.GetNewPasswordPassword(PWS); //reset password bool response = WebSecurity.ResetPassword(rt, newpassword); if (response) help.CreateEmail(un, newpassword); else TempData["Message"] = "Hey, avoid random request on this page."; } else TempData["Message"] = "Username and token not maching."; return View(); }