`definePageMeta({ auth: {} })` disables auth for the page
Environment
- Operating System: Darwin
- Node Version: v20.16.0
- Nuxt Version: 3.12.4
- CLI Version: 3.14.0
- Nitro Version: 2.9.7
- Package Manager: [email protected]
- "@sidebase/nuxt-auth": "^0.8.2",
Reproduction
The following page when navigated to redirects the user to the default login page:
<script setup lang="ts">
definePageMeta({
auth: true,
});
</script>
<template>yeet</template>
Changing the bool value of auth to an object and including navigateUnauthenticatedTo, user can now see the contents of the page and is not redirected:
<script setup lang="ts">
definePageMeta({
auth: {
navigateUnauthenticatedTo: "/auth/error",
},
});
</script>
<template>yeet</template>
Describe the bug
When using the navigateUnauthenticatedTo method on a page, the user is able to view the contents of that page and is not redirected to the specified page, indicating that auth is disabled.
Additional context
No response
Logs
No response
Thank you for the report, I've been able to reproduce it simply by using
definePageMeta({
auth: {}
})
I will provide a fix shortly
For the context @mackenzie-3spread - you are now required to provide unauthenticatedOnly option, otherwise it will default to Guest Mode (which you were incorrectly experiencing)
https://auth.sidebase.io/guide/application-side/protecting-pages#unauthenticatedonly