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