fix redirect issue in firefox and safari

This commit is contained in:
miloschwartz
2025-10-05 14:59:34 -07:00
parent 165f4023d0
commit 9649d9a46b
4 changed files with 87 additions and 42 deletions

View File

@@ -57,9 +57,12 @@ function parseSetCookieString(
}
if (!options.domain) {
const d = host ? new URL(env.app.dashboardUrl).hostname : undefined;
const d = host
? host.split(":")[0] // strip port if present
: new URL(env.app.dashboardUrl).hostname;
if (d) {
options.domain = d;
console.log("Setting cookie domain to:", d);
}
}
@@ -91,7 +94,8 @@ async function makeApiRequest<T>(
res = await fetch(url, {
method,
headers,
body: body ? JSON.stringify(body) : undefined
body: body ? JSON.stringify(body) : undefined,
cache: "no-store"
});
} catch (fetchError) {
console.error("API request failed:", fetchError);