I am confused with adding ASP.NET Core Identity to my web app. I would like to use parts of the default UI and controllers for my Razor Pages app, such as Login.cshtml and login.cshtml.cs or the register view and controller. However, I dont want to have all the added on 30+ pages along with it.
Scaffolding the views and controllers with .NET CLI only overrides the default RCL. That means I am still able to go to the specified URL from my home page such as Name of Website/Identity/Account/AccessDenied. The only way (that I have seen thus far) of disabling the default UI and controllers is to actually disable it on a per page/controller basis as outlined here. This means Id have to add all the default UIs and controllers to my app and then disable them? Is there no other way to only use the pages and pageModels that you want while using Identity?
UPDATE:
Here are some examples of others asking the same question. See the comment mentioned in the accepted answer to this stackoverflow question to "disable registrations or change redirect routes via Startup.cs without having to scaffold"
Please also see this issue on gitHub about it. Has nothing changed? Is it not easier to just forget the default UI and only add the service AddIndentity and not call AddDefaultUI then create the logic and views yourself to handle users. The whole point of adding Identity as a service is so that you dont have to write and maintain your own code. This seems backwards to me.