[英].NET Core 2.2 Unable to reach Controller but scaffolded Login works
I am currently unable to reach my Account Controller. 我目前无法联系我的客户经理。 I am replacing the Scaffolded Identity Login due to certain reasons.
由于某些原因,我将替换脚手架身份登录。
The current path to my AccountController is Areas > Identity > Pages > Account > AccountController 我AccountController的当前路径是Areas> Identity> Pages> Account> AccountController
Previously it would be Areas > Identity > Pages > Account > Login 以前是Areas> Identity> Pages> Account> Login
This is the top of my AccountController 这是我的AccountController的顶部
[Area("Identity")]
[AllowAnonymous]
[TypeFilter(typeof(ValidateApplicationStatusFilter), Arguments = new object[] { ApplicationGlobals.DocumentStudio })]
public class AccountController : Controller
In my Startup.cs I have set the loginpath as this: 在我的Startup.cs中,我将登录路径设置为:
options.LoginPath = "/Identity/Account/Login";
I have tried to put a debugger on my Login function in the AccountController but it never hits. 我试图在AccountController的Login函数中放置调试器,但从未成功。 When I login now, it shows me a different login form that seems to be the default created by .net?
现在登录时,它显示了另一种登录表单,该表单似乎是.net创建的默认登录表单?
I found out what the issue was. 我发现了问题所在。
In Startup.cs, I was using 在Startup.cs中,我正在使用
services.AddDefaultIdentity
This somehow forced it to use the default login page. 这迫使它使用默认的登录页面。 When I changed it to
当我将其更改为
services.AddIdentity
It worked. 有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.