Auth Error in Vercel

Hey, I have a project with the latest version, deployed at vercel.

Error building context. Error: Exception in getAuthenticationContext: The Authorization header is not valid."}

I get this error whenever I try to call any useAuth function, and it fails. I do NOT get this error locally. I’ve tried redeploying, upgrading my packages, cleaning my cache etc. Anything other than the useAuth() functions work properly.

For instance, when signing up, a new user is successfully created, but isAuthenticated is always false due to the error above.

Anyone with a similar problem?

Hi @TheRWdev one thing to check is that you have all the envars needed to verify the auth cookie such as the Session Secret.

See Self-hosted Authentication (dbAuth) | RedwoodJS Docs for the variables need to be set (and set to expected values) in Vercel settings for your app.

Also, in Vercel function logs is there any other info?

@TheRWdev were you able to get this resolved? This is the same problem I am having which is fully described in a github issue I created [Bug?]: Cookie/auth issues for vercel deployment on versions v8 + · Issue #11641 · redwoodjs/redwood · GitHub . I believe @dthyresson was going to take a look but linking the github issue here again as it has full details on how to repro.

@jgal1 @dthyresson Unfortunately I couldn’t get this error resolved. I checked the environment variables, including all my API keys and the session secret, but could not prevent the error. What I did after running out of solutions was that I reset my project to an older version that worked, and added the same code on top of it.

The working project right now uses redwood 7.7.3

Thanks for the Github issue @jgal1 I hope it gets resolved asap.