update function login
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-16 09:57:55 +07:00
parent 6fa15b69e7
commit 9aee5f4100
19 changed files with 2272 additions and 64 deletions

View File

@@ -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 });
})();