nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 924 forks source link

nuxt.config.ts not loading auth from nuxt.config.ts #1847

Open Nezo96 opened 1 year ago

Nezo96 commented 1 year ago

Okay so idk if this is bug or i am dumb but when i add auth to nuxt.config.ts it seems to not detecting it. Idk why.

my nuxt.config.ts

export default defineNuxtConfig({
  modules: ["@sidebase/nuxt-auth"],
  css: ["~/assets/css/main.css"],
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  },
  runtimeConfig: {
    authSecret: "adsadawdawdawdawdadsadasd",
  },
  auth: {
    globalAppMiddleware: true,
  },
});

but if i use local middleware it works pefectly

definePageMeta({
  middleware: "auth",
  auth: {
    unauthenticatedOnly: true,
    navigateAuthenticatedTo: "/user-profile/getting_up",
  },
});
genu commented 1 year ago

It looks like you are trying to use this in Nuxt 3.

The docs probably need to be more clear, but this module is for Nuxt 2 only