I’ll admit this one had me stumped.
When you create a Blazor Server App and add authorisation out of the box, you get some really neat baked in pages e.g. Login, Registration, Log Out etc., that takes the pain out of you having to code the entire user registration, authentication and authorisation process.
This is a fantastic feature and saves a tonne of time.
However, I was caught out a little. I wanted to customise the Login page and remove some of the layout, but I couldn’t find it in the Identity/Accounts folder. How do we fix that?
If you right click on your project and choose New -> Add Scaffolded Item, then choose Identity from the menu on the left.
You’ll get a list of pages you can override in the solution.
Here you can choose to overwrite them all or just choose the one you’re interested in.
You’ll then be able to customise any of the pages you choose.
Be carfeul though, if you choose to override the Log Out page, you will run into some issues. A resolution to this can be found here.
Need to know more about Blazor authentication and authorisation? Check out this page over on Microsoft Docs.