I have the following:
[Route("whitelist")]
[Authorize(Roles = "Administrator")]
public ActionResult Whitelist() {
var vm = new WhitelistViewModel();
return View(vm);
}
[Route("login")]
[AllowAnonymous]
public ActionResult Login(string returnUrl) {
ViewBag.ReturnUrl = returnUrl;
return View();
}
However, when I navigate to /whitelist
as an unauthenticated user, I get navigated to /Account/Login, which is invalid. How do I tell MVC5 to use the attribute routes when redirecting in this case?