I have this link in Home.cshtml (This has an ActionResult of public ActionResult Home()
)
<li class="home-links home-middleLast">@Html.ActionLink("Log out", "LogOut", "Home")</li>
It is suppose to link to this controller
// /LogOut
public ActionResult LogOut()
{
FormsAuthentication.SignOut();
TempData.Clear();
Session.Abandon();
getDB.Close();
return RedirectToAction("Home");
}
I made this happen using this
[Route("~/log_out")]
and this
routes.MapMvcAttributeRoutes();
My concern is that someone could type in /log_out
into the url and it would log out of the account. How can I make it so that people won't do that?
I want to make it so you have to click the link to log out instead of typing in /log_out
into the url.