@auth0/nextjs-auth0 - user returns undefined after successful login - vercel

Everything works on localhost, and my hosted site has been running fine since last year on vercel, but all of a sudden the useUser hook is not returning the user profile object, but showing successful login on the auth0 user history.
I’m guessing it’s something to do with vercel but I can’t find any answers.
There was a 400 error from the callback url at first, so I un/re-installed the npm package to a newer version, and now there is no error but my page won’t load into its logged-in state like it used to.

1 Like

Don’t know if this is your exact issue, but I was running into similar behaviour with NextJS/Vercel/nextjs-auth0 , and setting the env var AUTH0_SESSION_STORE_ID_TOKEN to false in my Vercel project settings fixed it for me.

I found this suggestion from this thread: getSession() on API route returns null when also using getSession() in middleware on Vercel · Issue #1085 · auth0/nextjs-auth0 · GitHub