Closed MvRemmerden closed 1 year ago
Are you suggesting any particular changes to this package? It's already possible to use any header you want to pass the ID token (see #520)—though I see that the README needs to be updated to include that info.
@kmjennison What do you think about changing the default to a way that works with Vercel? My assumption would be that Vercel is the main provider people will be using, and if this package doesn't work out of the box, but requires configuration changes, that's not a great first experience.
Otherwise, we could leave a comment in the code linking to the StackOverflow discussion.
@MvRemmerden Do you know how to reproduce the Vercel problem? The demo for this project deploys on Vercel without a problem using the Authorization header, as does another project I've worked on. This issue is the first I've seen of this problem, which makes me wonder if it's caused by some non-standard Vercel configuration.
I have a minimal and functional project live where that's the case, but it's private. Should I invite you to the repo and Vercel project?
Would you be willing to clone and deploy the demo app publicly to your Vercel? That would be the most helpful reproduction of the problem.
Closing until there's a reproduction with a common Vercel use-case.
Describe the bug
When deploying the example via Vercel, the
ssr-auth-required
andssr-no-token
examples lead to a 500 error. When looking at the logs in Vercel, the reason was that theapi/example
endpoint gives 400 response.Interestingly it only did so for the token authentication, but not for the cookie authentication. When searching for why that could be the case, I came across this StackOverflow answer that states that Vercel strips the
Authorization
header in certain circumstances: https://stackoverflow.com/a/71516546Following their proposal to rename
Authorization
tox_authorization
did solve the problem for me.Versions
next-firebase-auth
version: 1.0.0-canary.19Firebase JS SDK
: 9.19.1Next.js
: 13.3.0