diff --git a/client/src/router/guards.ts b/client/src/router/guards.ts index 41c23687..74fb3b52 100644 --- a/client/src/router/guards.ts +++ b/client/src/router/guards.ts @@ -1,5 +1,6 @@ import type {NavigationGuardWithThis, RouteLocationNormalized} from 'vue-router'; -import {UserState, useUserStore} from '@/stores/user' +import {useUserStore} from '@/stores/user' +import type {UserState} from '@/stores/user' import type {Store} from 'pinia'; const cookieName = 'loginStatus' @@ -31,11 +32,11 @@ const getCookieValue = (cookieName: string): string => { } // Pina is not ready when router is called the first time by app.use(), so we need to load it here -const getUserStore = (): UserState => { +const getUserStore = (): UserState & Store => { if (!userStore) { userStore = useUserStore() } - return userStore as unknown as UserState + return userStore as unknown as UserState & Store } const loginRequired = (to: RouteLocationNormalized) => {