Search code examples
entity-frameworkasp.net-corecode-generationasp.net-core-scaffolding

what is the path to login page?


We added the scaffolding for identity.
We didn't override any pages.
Now I can't reach the login or register pages.

From this post Where are the Login and Register pages in an AspNet Core scaffolded app?

I expect to find the Register page at

mydomain.com/Account/Register

or

mydomain.com/Identity/Account/Register

also tried

mydomain.com/Identity/Register

_loginPartial.cshtml has

<li class="nav-item">
    <a class="nav-link text-dark" id="register" asp-area="Identity" asp-page="/Account/Register">Register</a>
</li>

but that by itself isn't enough to make the links exist.


Solution

  • By default, correct URL would be:

    mydomain.com/Identity/Account/Register
    mydomain.com/Identity/Account/Login
    

    You can check Startup.cs (Program.cs) for routing configuraton. Also if you check _LoginPartial.cshtml file, it should have exact links to register and login pages.