Init
This commit is contained in:
1 parent
b3d2654779
commit
ccfea3d3cf
14 files changed
+374
-167
No files matched your search
@@ -8,6 +8,7 @@
|
||||
import {createRouter, createWebHistory} from 'vue-router'
|
||||
|
||||
import {useAuthStore} from '@/stores/auth'
|
||||
import {useSessionStore} from '@/stores/session'
|
||||
import AuthLayout from "@/layouts/AuthLayout.vue";
|
||||
import AppLayout from "@/layouts/AppLayout.vue";
|
||||
import AdminLayout from "@/layouts/AdminLayout.vue";
|
||||
@@ -80,9 +81,10 @@ const router = createRouter({
|
||||
})
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
const sessionStore = useSessionStore()
|
||||
const authStore = useAuthStore()
|
||||
if (!authStore.isInitialized) {
|
||||
await authStore.initialize()
|
||||
if (!sessionStore.isReady) {
|
||||
await sessionStore.bootstrap()
|
||||
}
|
||||
|
||||
const publicPages = ['login', 'join']
|
||||
|
||||
Reference in new issue
Block a user