mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +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:
@ -4,7 +4,18 @@ import { defineConfig } from "@hey-api/openapi-ts";
|
||||
|
||||
// biome-ignore lint/style/noDefaultExport: needed for openapi-ts
|
||||
export default defineConfig({
|
||||
client: "@hey-api/client-fetch",
|
||||
input: resolve(__dirname, "./staticfiles/generated/openapi/schema.json"),
|
||||
output: resolve(__dirname, "./staticfiles/generated/openapi"),
|
||||
output: {
|
||||
lint: "biome",
|
||||
format: "biome",
|
||||
path: resolve(__dirname, "./staticfiles/generated/openapi"),
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
name: "@hey-api/client-fetch",
|
||||
baseUrl: false,
|
||||
runtimeConfigPath: "./openapi-csrf.ts",
|
||||
exportFromIndex: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
Reference in New Issue
Block a user