owltide/pages/index.vue
Hornwitser e8226e0062 Implement account type restricted page
Add allowedAccountTypes page metadata which the authenticated middleware
uses to further restrict the types of accounts that can access the page.

If the account type is insufficent to access the page it will return an
HTTP 403 Forbidden status, which is rendered using the error page.
2025-03-09 22:37:07 +01:00

23 lines
577 B
Vue

<template>
<main>
<h1>Schedule Demo</h1>
<ul>
<li>
<NuxtLink to="/schedule">View Schedule</NuxtLink>
</li>
<li v-if="session?.account?.type === 'admin' || session?.account?.type === 'crew'">
<NuxtLink to="/edit">Edit Schedule</NuxtLink>
</li>
<li v-if="session">
<NuxtLink to="/account/settings">Account Settings</NuxtLink>
</li>
<li v-if="!session">
<NuxtLink to="/login">Log In / Create Account</NuxtLink>
</li>
</ul>
</main>
</template>
<script lang="ts" setup>
const { data: session } = await useAccountSession();
</script>