In my ASP.NET Core MVC application, I would like to rename AccountController
to something else ('Login', 'Authorization', does not matter the specific name).
But when I do this, the site still tries to route to /Account/Login
even though there is no such thing. What do I need to do in order to stop this and have it use the right route?
I am setting options.LoginPath
in services.ConfigureApplicationCookie
but this does not seem to change things.
Here is my config setup:
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Path = "/";
options.AccessDeniedPath = new PathString($"/{nameof(Errors)}/{nameof(Errors.Access_Denied)}");
options.ExpireTimeSpan= TimeSpan.FromMinutes(5); // note: testing to see if this enforces logout based on minutes of idle time
options.SlidingExpiration = true;
options.LoginPath = new PathString($"/{nameof(Authorization.Authorization)}/{nameof(Authorization.Authorization.Login)}");
});
Any suggestions? (Please ignore the nameof calls if they confuse you)
question from:
https://stackoverflow.com/questions/65617424/rename-accountcontroller-in-asp-net-core 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…