We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to Validate the CSRF-Token on every Request Please Guide me how to do that in this API framework
The text was updated successfully, but these errors were encountered:
Hi @Ammadhashmi
I will keep this open...
The plan is to allow to pass csrf flag either on top NinjaAPI(..., csrf=True) or per operation
NinjaAPI(..., csrf=True)
Sorry, something went wrong.
hi did you try the django way of protecting agains csrf.
since ninja use the same views function as django, does it didn't works when you add django.middleware.csrf.CsrfViewMiddleware in your middleware ?
django.middleware.csrf.CsrfViewMiddleware
by default Django Ninja have CSRF off but if you start using any cookie based authentication it will throw an error you need to set csrf flag to True:
csrf
True
api = NinjaAPI(csrf=True)
added in v.0.7.0
https://django-ninja.rest-framework.com/tutorial/csrf/
No branches or pull requests
I am trying to Validate the CSRF-Token on every Request Please Guide me how to do that in this API framework
The text was updated successfully, but these errors were encountered: