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
Instead of CSRFProtect.exempt that disables CSRF on a view for all requests, there should also be a way to disable it for all views based on the request context, like token authenticated requests for example.
Instead of
CSRFProtect.exempt
that disables CSRF on a view for all requests, there should also be a way to disable it for all views based on the request context, like token authenticated requests for example.For this the docs suggest
But it doesn't feel right to disable the extension globally, plus that way
CSRFProtect.exempt
is no longer usable.I tried something like
But CSRF protection runs and returns an error response before my hook gets called.
I am now going with a subclass:
One problem of this is that
g.csrf_valid
is internal to flask-wtf and not documented as part of the API so I don't know if it's a good idea to use it.The text was updated successfully, but these errors were encountered: