API reference
Middleware
The two global route guards: session and permissions.
auth.global.ts
Sends guests to /login?redirect=… unless the page uses the auth or landing-page layout or sets public: true. Sends signed-in users away from the auth pages unless the URL has ?preview.
permission.global.ts
When a page sets definePageMeta({ permission }) and the current role lacks it, aborts the navigation with a 403, which error.vue renders.