web/api: don't request/send session token to custom instances
This commit is contained in:
parent
b4599e68bb
commit
1f86faad12
1 changed files with 8 additions and 4 deletions
|
@ -9,9 +9,9 @@ import type { Optional } from "$lib/types/generic";
|
||||||
import type { CobaltAPIResponse, CobaltErrorResponse } from "$lib/types/api";
|
import type { CobaltAPIResponse, CobaltErrorResponse } from "$lib/types/api";
|
||||||
|
|
||||||
const request = async (url: string) => {
|
const request = async (url: string) => {
|
||||||
const gSettings = get(settings);
|
const currentSettings = get(settings);
|
||||||
const saveSettings = gSettings.save;
|
const saveSettings = currentSettings.save;
|
||||||
const privacySettings = gSettings.privacy;
|
const privacySettings = currentSettings.privacy;
|
||||||
|
|
||||||
const request = {
|
const request = {
|
||||||
url,
|
url,
|
||||||
|
@ -36,8 +36,12 @@ const request = async (url: string) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
await apiOverrideWarning();
|
await apiOverrideWarning();
|
||||||
|
|
||||||
|
const usingCustomInstance = currentSettings.processing.enableCustomInstances
|
||||||
|
&& currentSettings.processing.customInstanceURL;
|
||||||
const api = currentApiURL();
|
const api = currentApiURL();
|
||||||
const session = await getSession();
|
// FIXME: rewrite this to allow custom instances to specify their own turnstile tokens
|
||||||
|
const session = usingCustomInstance ? undefined : await getSession();
|
||||||
|
|
||||||
let extraHeaders = {}
|
let extraHeaders = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue