aspnet / Antiforgery

[Archived] AntiForgery token feature for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
78 stars 40 forks source link

Exception handler also throws #170

Closed drauch closed 6 years ago

drauch commented 6 years ago

In case the AntiForgeryToken cannot be decrypted the antiforgery infrastructure throws an exception which is handled (in my ASP.NET Core pipeline) using app.UseExceptionHandler("/Error"). However, the Error page cannot be rendered as the antiforgery infrastructure again throws - although the request is no longer really a POST request now...is there a workaround?

drauch commented 6 years ago

Hm, I needed to put [IgnoreAntiforgeryToken] on my error action.