Home > front end >  NuxtJS 3 - cannot use `nuxtjs/auth-next` module for authentication
NuxtJS 3 - cannot use `nuxtjs/auth-next` module for authentication

Time:11-24

Just trying to add authentication to my NuxtJs 3 app folloging nuxt/auth enter image description here

// nuxt.config.js

export default defineNuxtConfig({
    auth: {
        // ...
    },
    modules: [
        // '@nuxtjs/axios',
        '@nuxtjs/auth-next'
    ],
})

Received same error for @nuxtjs/axios but I just commented it out since its official documentation indicates to switch to $fetch API.

Cannot figure out where the error is

CodePudding user response:

nuxt-auth is not compatible with Nuxt3 as told here: https://github.com/nuxt-community/auth-module/issues/1805#issuecomment-1326287711

It's on the official roadmap but still not done by the core team.

In the meantime, you can probably google for a homemade solution online.
Thanks to Nuxt3 composables and some logic, it is totally achievable without an official module.

CodePudding user response:

At the time being, nuxt/auth module is not supported by Nuxt3.

You can find the list of modules supported by Nuxt3 here https://nuxt.com/modules?version=3.x

  • Related