This commit is contained in:
Benjamin Toby
2025-07-20 10:35:54 +01:00
parent dd1d05251d
commit a0a0ab8ee4
99 changed files with 5678 additions and 909 deletions
+3 -2
View File
@@ -49,14 +49,15 @@ export default async function fetchApi<
): Promise<R> {
let data;
const csrfValue = localStorage.getItem(localStorageCSRFKey || "csrf");
const csrfKey = "x-dsql-csrf-key";
const csrfValue = localStorage.getItem(localStorageCSRFKey || csrfKey);
let finalHeaders = {
"Content-Type": "application/json",
} as FetchHeader;
if (csrf && csrfValue) {
finalHeaders[csrfHeaderKey || "x-csrf-key"] = csrfValue;
finalHeaders[localStorageCSRFKey || csrfKey] = csrfValue;
}
if (typeof options === "string") {