nuxt-basic-auth-module icon indicating copy to clipboard operation
nuxt-basic-auth-module copied to clipboard

Not working with nuxt3

Open cmmata opened this issue 2 years ago • 5 comments

Hi!

I am having an error when trying to get this plugin to work with Nuxt3. Should be working, or is this plugin only intended to run with Nuxt2?

ℹ Register basic auth module to server middleware  

 ERROR  Cannot start nuxt:  Cannot read properties of undefined (reading 'handle')                                                                                                              

  at Function.use (node_modules/connect/index.js:87:21)
  at Object.set [as setLegacyMiddleware] (node_modules/@nuxt/nitro/dist/index.mjs:1875:13)
  at node_modules/nuxt3/dist/index.mjs:852:17
  at async initNuxt (node_modules/nuxt3/dist/index.mjs:945:3)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6717:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6756:5)
  at async _main (node_modules/nuxi/dist/chunks/index.mjs:384:7)

This is my nuxt.config.js

export default defineNuxtConfig({
  modules: [
    [
      'nuxt-basic-auth-module'
    ]
  ],
  alias: {
    images: resolve(__dirname, './public/images')
  },
  vite: {
    build: {
      chunkSizeWarningLimit: 1000
    }
  },
  basic: {
    name: 'AUTH USER NAME HERE',
    pass: 'AUTH PASSWORD HERE',
    enabled: 'true' // require boolean value(nullable)
  },
})

cmmata avatar Jan 03 '22 13:01 cmmata

Hey, currently the module only supports Nuxt 2.

Intevel avatar Apr 03 '22 18:04 Intevel

Hey, currently the module only supports Nuxt 2.

I see... And is there any plan to support Nuxt3? Obviously no need for deadlines, only intentions.

cmmata avatar Apr 04 '22 08:04 cmmata

Currently I don't know anything about plans from the module maintainer regarding Nuxt 3. However, the module is used by many and it would make sense to make it Nuxt 3 compatible. I'll take a look at it & try my best.

Intevel avatar Apr 04 '22 09:04 Intevel

any news on nuxt3 support?

degoya avatar Nov 24 '22 18:11 degoya

There is an module like this with Nuxt 3 Support https://github.com/xtranophilist/nuxt-basic-auth

Intevel avatar Nov 25 '22 07:11 Intevel