diff --git a/src/Frontend/src/App.vue b/src/Frontend/src/App.vue index ccaa60e86a..87c79741ba 100644 --- a/src/Frontend/src/App.vue +++ b/src/Frontend/src/App.vue @@ -9,10 +9,12 @@ import BackendChecksNotifications from "@/components/BackendChecksNotifications. import { storeToRefs } from "pinia"; import { useAuthStore } from "@/stores/AuthStore"; import { useAllowedRoutes } from "@/composables/useAllowedRoutes"; +import { useConfigurationStore } from "@/stores/ConfigurationStore"; const authStore = useAuthStore(); +const configurationStore = useConfigurationStore(); const route = useRoute(); -const { isAuthenticated, authEnabled } = storeToRefs(authStore); +const { isAuthenticated, authEnabled, loading } = storeToRefs(authStore); // Load the allowed-route manifest (my/routes) once authenticated, so the nav and other // UI can gate on it. Fail-safe: a missing/old endpoint just leaves the manifest unloaded @@ -33,6 +35,16 @@ const isAnonymousRoute = computed(() => route.meta?.allowAnonymous === true); const shouldShowApp = computed(() => !authEnabled.value || isAuthenticated.value || isAnonymousRoute.value); // Show full app layout (header, footer, notifications) only when authenticated or auth is disabled const shouldShowFullLayout = computed(() => !authEnabled.value || isAuthenticated.value); + +watch( + [loading, authEnabled, isAuthenticated], + ([isLoading, enabled, authenticated]) => { + if (!isLoading && (!enabled || authenticated)) { + configurationStore.ensureLoaded(); + } + }, + { immediate: true } +);