initiall commit

This commit is contained in:
Tomas Dvorak committed 2026-04-10 12:03:31 +02:00
commit 7ddfb1f52b
276 files changed
+37629

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { OpenAPI } from "@primora/api-client";
import { fetchApiToken } from "./auth-client";
OpenAPI.BASE = import.meta.env.VITE_API_BASE_URL ?? "/api/v1";
OpenAPI.CREDENTIALS = "include";
OpenAPI.WITH_CREDENTIALS = true;
OpenAPI.TOKEN = async () => (await fetchApiToken()) ?? "";
export function configureApiToken(tokenResolver?: () => Promise<string | undefined>) {
OpenAPI.TOKEN = tokenResolver ? async () => (await tokenResolver()) ?? "" : async () => (await fetchApiToken()) ?? "";
}