Search code examples
asp.net-core-mvcasp.net-core-identityasp.net-core-5.0

ASP.NET Core : specify controller name for logging in using identity


How to specify controller name for login, it always redirect me to Account/Login, I'm using different controller and I moved the login action to it but I can't use that action, Is there a default controller name setting in this case?


Solution

  • you can change in :

    services.ConfigureApplicationCookie(options =>
    {
         options.LoginPath = new PathString("/identity/Account/Login");
         options.AccessDeniedPath = new PathString("/identity/Account/AccessDenied");
    }