if (to.meta.middleware == "auth") {
if (store.getters.isUserAuthenticated) {
next();
} else {
next({ name: "sign-in" });
}
} else {
next();
}
v-if
directive in src/layouts/main-layout/MainLayout.vue.const isUserAuthenticated = computed(() => {
return store.getters.isAuthenticated();
});
<div
v-if="isUserAuthenticated"
class="d-flex flex-column flex-root app-root"
>
</div>