gpt4 book ai didi

c# - 如何删除默认的 ASP.NET Core Identity 端点?

转载 作者:行者123 更新时间:2023-12-05 09:14:46 25 4
gpt4 key购买 nike

假设我想编写自己的登录、注销端点及其 View

但出于某种原因,我很难删除现有的端点

每当我删除可能与这些端点相关联的东西时,它们就会重新创建自己并返回它们的默认 View 。

基本上,我想尽可能多地删除从 ASP.NET Core Identity 生成的默认端点/ View

关于如何实现该目标的任何想法?

        "Templates/Identity/Pages/Account/Account.AccessDenied.cs.cshtml",
"Templates/Identity/Pages/Account/Account.AccessDenied.cshtml",
"Templates/Identity/Pages/Account/Account.ConfirmEmail.cs.cshtml",
"Templates/Identity/Pages/Account/Account.ConfirmEmail.cshtml",
"Templates/Identity/Pages/Account/Account.ExternalLogin.cs.cshtml",
"Templates/Identity/Pages/Account/Account.ExternalLogin.cshtml",
"Templates/Identity/Pages/Account/Account.ForgotPassword.cs.cshtml",
"Templates/Identity/Pages/Account/Account.ForgotPassword.cshtml",
"Templates/Identity/Pages/Account/Account.ForgotPasswordConfirmation.cs.cshtml",
"Templates/Identity/Pages/Account/Account.ForgotPasswordConfirmation.cshtml",
"Templates/Identity/Pages/Account/Account.Lockout.cs.cshtml",
"Templates/Identity/Pages/Account/Account.Lockout.cshtml",
"Templates/Identity/Pages/Account/Account.Login.cs.cshtml",
"Templates/Identity/Pages/Account/Account.Login.cshtml",
"Templates/Identity/Pages/Account/Account.LoginWith2fa.cs.cshtml",
"Templates/Identity/Pages/Account/Account.LoginWith2fa.cshtml",
"Templates/Identity/Pages/Account/Account.LoginWithRecoveryCode.cs.cshtml",
"Templates/Identity/Pages/Account/Account.LoginWithRecoveryCode.cshtml",
"Templates/Identity/Pages/Account/Account.Logout.cs.cshtml",
"Templates/Identity/Pages/Account/Account.Logout.cshtml",
"Templates/Identity/Pages/Account/Account.Register.cs.cshtml",
"Templates/Identity/Pages/Account/Account.Register.cshtml",
"Templates/Identity/Pages/Account/Account.ResetPassword.cs.cshtml",
"Templates/Identity/Pages/Account/Account.ResetPassword.cshtml",
"Templates/Identity/Pages/Account/Account.ResetPasswordConfirmation.cs.cshtml",
"Templates/Identity/Pages/Account/Account.ResetPasswordConfirmation.cshtml",
"Templates/Identity/Pages/Account/Account._ViewImports.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ChangePassword.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ChangePassword.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.DeletePersonalData.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.DeletePersonalData.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.Disable2fa.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.Disable2fa.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.DownloadPersonalData.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.DownloadPersonalData.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.EnableAuthenticator.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.EnableAuthenticator.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ExternalLogins.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ExternalLogins.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.GenerateRecoveryCodes.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.GenerateRecoveryCodes.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.Index.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.Index.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ManageNavPages.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.PersonalData.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.PersonalData.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ResetAuthenticator.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ResetAuthenticator.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.SetPassword.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.SetPassword.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ShowRecoveryCodes.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.ShowRecoveryCodes.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.TwoFactorAuthentication.cs.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage.TwoFactorAuthentication.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage._Layout.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage._ManageNav.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage._StatusMessage.cshtml",
"Templates/Identity/Pages/Account/Manage/Account.Manage._ViewImports.cshtml",
(...)

最佳答案

您不能使用 AddDefaultIdentity ,因为在内部,这调用 AddDefaultUI ,其中包含您不需要的 Razor Pages“端点”。您需要使用 AddIdentity<TUser, TRole>AddIdentityCore<TUser>相反。

关于c# - 如何删除默认的 ASP.NET Core Identity 端点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53559810/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com