This commit is contained in:
@@ -40,7 +40,10 @@
|
||||
}
|
||||
|
||||
async function apiJson(url, opts = {}) {
|
||||
const res = await fetch(url, opts);
|
||||
if (window.AuthApp && !window.AuthApp.isReady()) {
|
||||
throw new Error("not authenticated");
|
||||
}
|
||||
const res = await fetch(url, { credentials: "include", ...opts });
|
||||
const text = await res.text();
|
||||
let data = null;
|
||||
try {
|
||||
@@ -440,5 +443,9 @@
|
||||
refreshAll,
|
||||
};
|
||||
|
||||
init();
|
||||
function boot() {
|
||||
init();
|
||||
}
|
||||
if (window.AuthApp?.isReady()) boot();
|
||||
else window.addEventListener("lm:auth-ready", boot, { once: true });
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user