permission system and no access redirect

This commit is contained in:
Julian Krauser 2024-08-26 13:46:54 +02:00
parent 214f0ddf21
commit cb80771f7a
8 changed files with 107 additions and 18 deletions

View file

@ -0,0 +1,32 @@
<template>
<div class="flex flex-col items-center">
<br />
<h1 class="w-full p-4 text-center font-bold text-3xl">Kein Zugriff</h1>
<br />
<p class="w-full text-center">
Sie haben keine Berechtigungen. <br />
Um Zugriff auf das Admin-Portal zu erhalten, wenden Sie sich an einen Administrator.
</p>
<br />
<button primary class="!w-fit" @click="refetch">Zum Admin-Portal</button>
</div>
</template>
<script lang="ts" setup>
import { refreshToken } from "@/serverCom";
import { defineComponent } from "vue";
</script>
<script lang="ts">
export default defineComponent({
methods: {
async refetch() {
await refreshToken()
.then(() => {
this.$router.push({ name: "admin" });
})
.catch(() => {});
},
},
});
</script>