frontend/app.vue
2025-06-05 21:51:14 +02:00

28 lines
478 B
Vue

<template>
<ClientOnly>
<NuxtPage></NuxtPage>
</ClientOnly>
</template>
<script setup lang="ts">
import type { RouteLocation } from 'vue-router';
// Guard dashboard and redirect to login
useRouter().beforeEach((route: RouteLocation) => {
guard(route.fullPath);
});
guard(useRoute().fullPath);
function guard(route: string)
{
if(route.startsWith('/dashboard') && getToken() == null)
{
useRouter().push('/');
}
}
useHead({
title: 'Kubooboo'
})
</script>