-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ControllerTypeExtensions should look for ControllerBase type #16187
Conversation
@Skrypt this is a good change. What would be better "if you like", is converting these to minimalAPI instead. Here is an example of MinimalAPI converting that I did recently https://github.com/OrchardCMS/OrchardCore/pull/16174/files |
Yeah, could be that too but we still need to fix the issue for those who want to use this method with their ApiControllers. So, I think that would be a different PR. |
@@ -25,15 +25,15 @@ public static ActionResult ChallengeOrForbid(this Controller controller) | |||
/// <param name="controller"></param> | |||
/// <param name="authenticationSchemes">The authentication schemes to challenge.</param> | |||
/// <returns>The proper actionresult based upon if the user is authenticated.</returns> | |||
public static ActionResult ChallengeOrForbid(this Controller controller, params string[] authenticationSchemes) | |||
public static ActionResult ChallengeOrForbid(this ControllerBase controller, params string[] authenticationSchemes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastienros There is also this which needed to also be extended on top of the ControllerBase just because we need it for Api Controllers too.
More on this. When inheriting return View(); Which should not be options that are available with an ApiController. |
Yep! |
Fixes #16186