Middlewares

  • In order to protect your routes, you can use the authenticated middleware that comes with the layer.
  • If you wanna avoid a user to enter a route if he's already logged-in, you can use the unauthenticated middleware.

Example

~/pages/protected.vue
<script setup lang="ts">definePageMeta({    middleware: 'authenticated'})</script><template>    <!-- ... --></template>