Enable csrf tokens on API routes

* Upgrade openapi-ts
* Migrate openapi-ts settings to new version
* Add csrf token to headers of all API calls
* Force csrf token authentication on API routes
This commit is contained in:
2025-03-03 13:33:58 +01:00
parent b3f67657d7
commit fe417b0c29
5 changed files with 49 additions and 18 deletions

View File

@ -27,7 +27,7 @@ handler403 = "core.views.forbidden"
handler404 = "core.views.not_found"
handler500 = "core.views.internal_servor_error"
api = NinjaExtraAPI(version="0.2.0", urls_namespace="api")
api = NinjaExtraAPI(version="0.2.0", urls_namespace="api", csrf=True)
api.auto_discover_controllers()
urlpatterns = [