nuxt/example-auth0

auth stuck at the callback URL — not storing Auth0 token

maxiride opened this issue · 1 comments

Version

v4.8.5

Reproduction link

https://nuxt.federicod.dev/

Steps to reproduce

  1. git clone https://github.com/nuxt/example-auth0.git;
  2. set Auth0 domain and client_id into nuxt.config.js (I am not using the .env file as it seems to me that it doesn't get embedded in the SPA after running npm run build)
  3. set mode: spa
  4. nuxt build
  5. deploy the dist folder
  6. access the website and try to login with demo@demo.com; Demo1@23
  7. after the callback URL is opened, it stays stuck there

On a more complicated platform I am developing, some API calls that are made on the callback URL to populate a Vuex store all yields unauthorized error, meaning that the token doesn't get stored at all.

When running example-auth0 and the application I am developing in development mode with npm run dev, everything works fine. So I suppose that something goes wrong only after running the build command.

What is expected ?

I expect the callback URL to be opened and the token received stored.

What is actually happening?

The SPA stays stuck at the callback URL and no token is stored.

Additional comments?

Webserver: Caddy
Configuration:

nuxt.federicod.dev {
        root /root/dev/example-auth0/dist
}

No errors are shown in the console.

This bug report is available on Nuxt community (#c46)

Issue moved to the mainstream library here nuxt-community/auth-module#536

I cannot test if this issue is with Auth0 only or any provider in SPA.