New eveal #32
+4
-2
@@ -17,10 +17,11 @@ const router = createRouter({
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.use(pinia);
|
app.use(pinia);
|
||||||
app.use(router);
|
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
|
||||||
|
await authStore.bootstrap();
|
||||||
|
|
||||||
router.beforeEach(to => {
|
router.beforeEach(to => {
|
||||||
if (!to.meta.public && !authStore.isAuthenticated) {
|
if (!to.meta.public && !authStore.isAuthenticated) {
|
||||||
return {name: routeNames.home};
|
return {name: routeNames.home};
|
||||||
@@ -28,4 +29,5 @@ router.beforeEach(to => {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
authStore.bootstrap().finally(() => app.mount('#app'));
|
app.use(router);
|
||||||
|
app.mount('#app');
|
||||||
Reference in New Issue
Block a user