nuxt-alt / auth

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

middleware on select pages is not working #29

Closed azmatzuberi closed 1 year ago

azmatzuberi commented 1 year ago

Following the original nuxt auth system, I put middleware: 'auth' on a page, but I could still navigate to it without being logged on. I then went to the module options and put enableMiddleware: true but still no luck.

lowbits commented 1 year ago

@azmatzuberi did you add redirects in your config file? Im using the package and login redirect it working


//nuxt.config.ts
auth: {
    redirect: {
      login: '/auth/signin',
      callback: '/auth/signin',
    },
}

``
steklopod commented 1 year ago

If you use Vue 3 - middleware: 'auth' will not work.

mcazeneuve commented 1 year ago

with nuxt3 it works