mirror of
https://github.com/ae-utbm/sith.git
synced 2025-03-09 23:07:11 +00:00
* 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
10 lines
235 B
TypeScript
10 lines
235 B
TypeScript
import Cookies from "js-cookie";
|
|
import type { CreateClientConfig } from "#openapi";
|
|
|
|
export const createClientConfig: CreateClientConfig = (config) => ({
|
|
...config,
|
|
headers: {
|
|
"X-CSRFToken": Cookies.get("csrftoken"),
|
|
},
|
|
});
|