mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
fix: prevent auth layout swap while still on login/register route
The v-if in App.vue switches to the authenticated layout (navbar + sidebar) as soon as authStore.authUser becomes truthy. But Vue's reactivity flush runs before the await continuation in submit(), so the layout swaps while the route is still /login, causing the login form to flash inside the authenticated shell for ~250ms. Fix by adding a route check: don't show the authenticated layout while the current route is an auth page (login, register, password reset, openid). The NoAuthWrapper stays visible until redirectIfSaved() navigates away, then the authenticated layout renders cleanly.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Ready>
|
||||
<template v-if="authStore.authUser">
|
||||
<template v-if="showAuthLayout">
|
||||
<AppHeader />
|
||||
<ContentAuth />
|
||||
</template>
|
||||
@@ -57,6 +57,15 @@ const baseStore = useBaseStore()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const AUTH_ROUTE_NAMES = new Set([
|
||||
'user.login',
|
||||
'user.register',
|
||||
'user.password-reset.request',
|
||||
'user.password-reset.reset',
|
||||
'openid.auth',
|
||||
])
|
||||
const showAuthLayout = computed(() => authStore.authUser && !AUTH_ROUTE_NAMES.has(route.name as string))
|
||||
|
||||
useBodyClass('is-touch', isTouchDevice())
|
||||
const keyboardShortcutsActive = computed(() => baseStore.keyboardShortcutsActive)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user