When creating a new project in VS 2015 WebApplication, how would you go about changing the Redirect LoginUrl Path when not Authorize'd?
I have created a new Area, where I have created a loginController. This loginController requires you are Authorize'd. But when trying to reach the pages, I am redirected to "/Account/Login".
How would I go about changing this path to "/AREA/Login/Index"?
services.AddIdentity<ApplicationUser, ApplicationRole>(options =>
{
options.Cookies.ApplicationCookie.LoginPath = "/Login";
});
Try doing the following:
services.Configure<CookieAuthenticationOptions>(options =>
{
options.LoginPath = new PathString("/<YOUR-AREA>/Account/Login");
});
Question: Did you decorate your controller with an [Area]
attribute?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With