Basic Auth + sidebase/nuxt-auth results in a 401 error.
I have a Nuxt3 project using the Sidebase/nuxt-auth module. I'm trying to secure my staging page with basic authentication, but I'm facing issues. After implementing basic auth, the authentication prompt appears on every page refresh, and I receive a 401 error on the first attempt.
https://nuxt.com/modules/nuxt-basic-auth
I've tried setting up basic auth both through the Sidebase module and in the Kubernetes ingress file, but in both cases, the modal prompts appear with each refresh, and the initial attempt results in a 401 error.
Does anyone have insights on why this might be happening and how to resolve it? Thank you!"
2 Replies
you mention that you're using sidebase's nuxt-auth module but you're linking to kgierke's nuxt-basic-auth module. Which are you using?
@oneeachOh I will post it here and, if you want to reproduce the problem you can start a nuxt3
https://nuxt.com/docs/getting-started/installation
Then add sidebase module (here is the link on sidebase)
https://sidebase.io/nuxt-auth/getting-started/installation
and lastly basic-auth
https://nuxt.com/modules/nuxt-basic-auth
Nuxt
Installation · Get Started with Nuxt
Get started with Nuxt quickly with our online starters or start locally with your terminal.
Installation
How to install nuxt-auth.