Finally I have managed to disable the pages, following the instructions that appear in the documentation (links in the comments of the first message), but with a little changes.
I added these new scaffolded items:
- Account/Manage/Layout (previously added)
- Account/Manage/DeletePersonalData
- Account/Manage/Disable2fa
- Account/Manage/DownloadPersonalData
- Account/Manage/EnableAuthenticator
- Account/Manage/PersonalData
- Account/Manage/ResetAuthenticator
- Account/Manage/TwoFactorAuthentication
For DeletePersonalData, Disable2fa, DownloadPersonalData, EnableAuthenticator, PersonalData, ResetAuthenticator and TwoFactorAuthentication I removed all content from .cshtml and .cshtml.cs files, leaving them empty.
In _ManageNav.cshtml file I removed these list items:
<li class="nav-item"><a class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor" asp-page="./TwoFactorAuthentication">Two-factor authentication</a></li>
<li class="nav-item"><a class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data" asp-page="./PersonalData">Personal data</a></li>
In ManageNavPages.cs file I removed the following properties and methods:
public static string DownloadPersonalData => "DownloadPersonalData";
public static string DeletePersonalData => "DeletePersonalData";
public static string PersonalData => "PersonalData";
public static string TwoFactorAuthentication => "TwoFactorAuthentication";
public static string DownloadPersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DownloadPersonalData);
public static string DeletePersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DeletePersonalData);
public static string PersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, PersonalData);
public static string TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication);
As a result I get an 404 HTTP error in the navigator, and this was what I wanted.