New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login link not generated after following all the steps #8201
Comments
The URI should by /Account/Login, but even if I enter in the browser that addres, I get 404: |
Try |
The links are not generated because you don't have a valid route. I'm not sure what you did wrong. You can probably get a quicker response on StackOverflow. The login page doesn't use route data - so changing the PK doesn't affect routing. |
I did nothing else, it was an empty project. I just followed the instructions here. With the link I can provide the source code if necessary. |
That's because you're using the new 2.1 templates which use See |
You are right, thanks for pointing that out. I have copied the Thank you! |
I created an ASP.NET Core 2.1 MVC app with authentication enabled using individual user accounts (store user accounts in-app), and verified that the Identity's register and login links are generated correctly:
I followed the steps in this doc to change the identity user and identity role primary key to
After that, I notice the Identity's register and login links are generated correctly. They became "unrouted":
Not only the link are not generated correctly, the previously working URLs stopped showing the register and login page content too:
Is this a known issue? Any idea how I can fix this? Thank you. |
Thanks @Rick-Anderson, @scottaddie, @HaoK and @javiercn for finding the fix. The solution is to add
Note that this solution is applicable to ASP.NET Core 2.1 only, not for 2.0. See #6967 for similar issue. |
I'll be documenting this as part of #8605 |
A interface do usuário da identidade é implementada usando o Razor Pages. Para que o roteamento do nó de extremidade os mapeie, adicione uma chamada MapRazorPagesno seu UseEndpointsretorno de chamada: |
|
I followed all the steps here, and after switching primary key to <int>, the 'Register' and 'Login' links are not generated anymore. In my html page I have just this:
<a class="nav-link" href="">Login</a>
but the code looks like this:
<li class="nav-item"><a asp-page="/Account/Login" class="nav-link">Login</a></li>
For the page to work, I had to change the @Inject statements like this:
Anyone has an ideea why?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: