mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
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:
1 parent
b3f67657d7
commit
fe417b0c29
5 files changed
+49
-18
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import Cookies from "js-cookie";
|
||||
import type { CreateClientConfig } from "#openapi";
|
||||
|
||||
export const createClientConfig: CreateClientConfig = (config) => ({
|
||||
...config,
|
||||
headers: {
|
||||
"X-CSRFToken": Cookies.get("csrftoken"),
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user