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.
23 lines
577 B
Vue
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>
|