<script setup>

import PageTitle from "@/components/global/PageTitle.vue";
import PageLoader from "@/components/global/PageLoader.vue";

import { ref } from 'vue'
import { useRouter } from "vue-router";

const router = useRouter();

import { SessionUser } from "@/components/session/token/SessionUser.vue";
// If the user has the superuser permission, redirect to the superuser dashboard
if (SessionUser.canAccessSuperUser()) {
  router.push({ name: 'superuser' });
}

// If the user has the admin permission, redirect to the department dashboard
if (SessionUser.canAccessAdmin()) {
  router.push({ name: 'admin' });
}

// Redirect to dashboard (user is already logged in, or will be redirected to login page)
router.push({ name: 'dashboard' });
</script>

<template>
  <div>
    <PageLoader title="Omdirigerer..." />
  </div>
</template>

<style scoped>

</style>