make change that could possibly make the app work on a different subdomain than the api

This commit is contained in:
hippoz 2021-01-22 23:57:13 +02:00
parent e229afe026
commit 9ee72f7d9e
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

@ -6,6 +6,14 @@ async function APIRequest(endpoint, options) {
let isOK = false; let isOK = false;
let err; let err;
if (!options) options = {};
if (!options.headers) options.headers = {};
options = {
credentials: 'include',
...options
};
try { try {
res = await fetch(`${config.apiUrl}${endpoint}`, options); res = await fetch(`${config.apiUrl}${endpoint}`, options);
json = await res.json(); json = await res.json();