nuxt-alt / auth

An alternative module to @nuxtjs/auth
https://nuxt-alt-auth.vercel.app/
MIT License
94 stars 20 forks source link

Skip Global Middleware on Specific Route Using Script Setup #64

Closed joshwhitwell closed 10 months ago

joshwhitwell commented 10 months ago

Can you please add instructions to the documentation regarding how to skip the global authorization middleware on a particular route when using script setup syntax?

In Nuxt 2 / Options Api you could skip the global auth middleware on a particular route/component by using:

export default {
  auth: false
}

Is there a way to accomplish the same thing when using script setup / useAuth composable, e.g.

<script setup>
const { $auth } = useNuxtApp()
const auth = useAuth()
// How to skip auth here?

or somewhere in nuxt.config.ts?

Denoder commented 10 months ago

yea I should do that but here:

<script lang="ts" setup>
definePageMeta({
    auth: false
});
</script>