fix: expired token issue

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-07-05 11:36:20 -04:00
parent 502be95d7d
commit 6931dc9ff7
5 changed files with 33 additions and 23 deletions
+7
View File
@@ -8,6 +8,7 @@ import { useModuleStore } from '@KTXC/stores/moduleStore'
import { useTenantStore } from '@KTXC/stores/tenantStore'
import { useUserStore } from '@KTXC/stores/userStore'
import { fetchWrapper } from '@KTXC/utils/helpers/fetch-wrapper'
import { FetchError } from '@KTXC/utils/helpers/fetch-wrapper-core'
import { initializeModules } from '@KTXC/utils/modules'
import { createSessionMonitor } from '@KTXC/services/authManager'
import App from './App.vue'
@@ -62,5 +63,11 @@ globalWindow.Pinia = PiniaLib as unknown
app.mount('#app');
} catch (e) {
console.error('Bootstrap failed:', e);
// The private shell is unusable without /init. If the server rejected
// the session, drop the stale local identity and return to login.
if (e instanceof FetchError && (e.status === 401 || e.status === 403)) {
userStore.clearAuth();
window.location.href = '/login';
}
}
})();