1
votes

(super beginner alert)

in the "default" Blazor server side project with built in Login the LoginDisplay.razor file contains

<AuthorizeView>
<Authorized>
    <a href="Identity/Account/Manage">Hello, @context.User.Identity.Name!</a>
    <form method="post" action="Identity/Account/LogOut">
        <button type="submit" class="nav-link btn btn-link">Log out</button>
    </form>
</Authorized>
<NotAuthorized>
    <a href="Identity/Account/Register">Register</a>
    <a href="Identity/Account/Login">Log in</a>
</NotAuthorized>

let's take as example "Identity/Account/Register":

if I look into the "Identity" Area the only pages I find are

"Account" and "Shared"; none of which contains the aforementioned page.

what am I missing?

thank you

[edit] Following Chris Sainty answer (thank you)

but I'm experiencing this:

https://github.com/aspnet/AspNetCore/issues/13120

trying this solution

The steps, based on a Preview8 server-side project with "Individual user accounts" :

  • temporarily disable this line in Startup: // endpoints.MapBlazorHub(selector: "app");
  • run the scaffolding wizzard, add any pages you want
  • uncomment the endpoints.MapBlazorHub() line again
  • remove Pages/_ViewStart.cshtml
  • fix Pages/Shared/_Layout.cshtml, the first line is missing @using
  • fix Pages/Shared/_Loginpartial.cshtml, the second line is missing @inject
1
Didn't the link above have a solution to your issue ? Did you install the latest VS 2019 preview ?enet
I'm trying out the solution, but it's an open github issue, the environment is set up according to docsFrancesco Iapicca

1 Answers

2
votes

If you want to customise the Identity pages you have to scaffold them out first.

Say you want to customise the Register page, you would right click on your project and select:

Add > Scaffolded Item > Select Identity from the left menu and then click OK.

You'll then get a list of all the available pages and you can select which ones you want to override. Once you've done this the files will appear in your project and you can customise them as usual.