You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
public class MyPageModel : PageModel {
[HttpGet]
[Authorize] // does nothing
public void OnGet() { }
[HttpPost]
[AllowAnonymous] // does nothing
public async Task<ActionResult> OnPost()
}
Is it possible to use attributes per method on Razor Pages ? (i know the code provided does not work)
If it doesn't, I suggest an error or warning as it may lead to filter sensitive data.
The text was updated successfully, but these errors were encountered:
Thanks for contacting us, @Bartmax.
The Authorize attribute is not applicable to page handlers. You can apply it on the page model level, though.
This is a quesiton which keeps coming up and we plan to provide a guidance here by introducing an analyzer, which will work developers from doing that: #7684
Is this a Bug or Feature request?:
Question / Feature request
Description of the problem:
Is it possible to use attributes per method on Razor Pages ?
(i know the code provided does not work)
If it doesn't, I suggest an error or warning as it may lead to filter sensitive data.
The text was updated successfully, but these errors were encountered: