diff --git a/frontend/composables/use-auth-context.ts b/frontend/composables/use-auth-context.ts index c39ac3f..bcffad7 100644 --- a/frontend/composables/use-auth-context.ts +++ b/frontend/composables/use-auth-context.ts @@ -106,8 +106,8 @@ class AuthContext implements IAuthContext { this._expiresAt.value = null; this._attachmentToken.value = null; - navigateTo("/"); console.log("Session invalidated"); + window.location.href = "/"; } async login(api: PublicApi, email: string, password: string, stayLoggedIn: boolean) { diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index c98f1a1..479d1f4 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -20,7 +20,7 @@ export default defineNuxtConfig({ }, devOptions: { // Enable to troubleshoot during development - enabled: true, + enabled: false, }, manifest: { name: "Homebox", diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index 614a826..2258c4c 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -8,6 +8,9 @@ }); const ctx = useAuthContext(); + if (ctx.isAuthorized()) { + navigateTo("/home"); + } const api = usePublicApi(); const toast = useNotifier(); @@ -29,10 +32,6 @@ } }); - if (!ctx.isAuthorized()) { - navigateTo("/home"); - } - const route = useRoute(); const router = useRouter();