potato4d / nuxt-basic-auth-module

Provide basic auth your Nuxt.js application
https://www.npmjs.com/package/nuxt-basic-auth-module
MIT License
311 stars 9 forks source link

Does this work when the target is static ? #158

Closed kissu closed 3 years ago

kissu commented 4 years ago

So yeah, basically this module is working great while nuxt dev.

But when nuxt generate then nuxt start, so it's giving me

Environment: production
Rendering: server-side
Target: static

It just ignore the whole security even with enabled: true.

Wanted to be sure what is happening there. 😄

zeitchef commented 4 years ago

I'd love to know about this as well!

tallcoder commented 4 years ago

Good question! Would love to know that myself. It doesn't seem to, which is the only time I need this to work (when it's static). It working locally isn't very helpful.

potato4d commented 3 years ago

@kissu @tallcoder Nuxt.js's static mode works as a static website. In a static website, Nuxt.js only serves files and does not allow Node.js-derived functionality to operate. Therefore, the nuxt-basic-auth-module, which relies on Nuxt.js, does not work in static, which is the correct behavior.