According to @rynowak having attributes on these handlers isn't going to be possible.
@rynowak , @ryanbrandenburg
Okay, that I can do that simulate [IgnoreAntiforgeryToken] behaviour in razor pages?
@verysimplenick you should be able to annotate your Page model with the attribute and it should work now.
@pranavkm
yep, I already tried
[IgnoreAntiforgeryToken(Order = 1000)]
public class OfferModel : PageModel
But it's not working.
The validate antiforgery attribute that gets applied has an order of 1000 - https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.ViewFeatures/AutoValidateAntiforgeryTokenAttribute.cs#L40 so you might need a higher Order for IgnoreAntiforgeryToken to become effective. Could you bump it up (to 1001)?
@pranavkm Yes, it's works with Order > 1000, thanks.
Maybe need add it to docs of Razor Pages.
Most helpful comment
@pranavkm Yes, it's works with Order > 1000, thanks.
Maybe need add it to docs of Razor Pages.