fix: move WorkspaceAuthGate to LayoutDefault for proper re-login hand… (#8381)

## Summary

- Move WorkspaceAuthGate from App.vue to LayoutDefault.vue so it only
wraps authenticated routes
- Change initialize() to run in onMounted() for proper Vue lifecycle
- Restore immediate: true in cloudRemoteConfig watcher as backup
- Gate now mounts fresh after login, fixing re-login feature flag issue

The root cause was a race condition: after logout + page reload, the
cloudRemoteConfig watcher could be set up after the user already logged
in, missing the isLoggedIn change and never calling /features endpoint.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8381-fix-move-WorkspaceAuthGate-to-LayoutDefault-for-proper-re-login-hand-2f66d73d36508182a3dec09a49214a00)
by [Unito](https://www.unito.io)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Simula_r
2026-01-28 18:33:44 -08:00
committed by GitHub
parent e4f43d5cc4
commit fe7d89d1b1
4 changed files with 25 additions and 20 deletions

View File

@@ -1,11 +1,15 @@
<template>
<main class="relative h-full w-full overflow-hidden">
<router-view />
</main>
<WorkspaceAuthGate>
<main class="relative h-full w-full overflow-hidden">
<router-view />
</main>
</WorkspaceAuthGate>
</template>
<script setup lang="ts">
import { useFavicon } from '@vueuse/core'
import WorkspaceAuthGate from '@/components/auth/WorkspaceAuthGate.vue'
useFavicon('/assets/favicon.ico')
</script>