feat: kick out users who arent signed in

This commit is contained in:
kittentm 2026-03-21 03:42:36 +01:00
commit 50a36e2db4
No known key found for this signature in database
GPG key ID: AC43DFDBC1F44A91
4 changed files with 41 additions and 12 deletions

View file

@ -78,13 +78,21 @@ window.loadHeader(async function(headerContainer) {
}
try {
const [profileRes, rotationsData] = await Promise.all([
fetch("/api/v1/me", { credentials: 'include' }).then(res => res.ok ? res.json() : {}),
const [profileRes] = await Promise.all([
fetch("/api/v1/me", { credentials: 'include' }).then(res => {
if (res.redirected) {
window.location.href = res.url;
return {};
}
return res.ok ? res.json() : {};
}),
renderStages()
]);
await renderData(profileRes);
sessionStorage.setItem('user_cache', JSON.stringify(profileRes));
if (profileRes && Object.keys(profileRes).length > 0) {
await renderData(profileRes);
sessionStorage.setItem('user_cache', JSON.stringify(profileRes));
}
} catch (err) {
if (!cacheReady) {
const nameEl = document.getElementById('mii-name');