I created auth for my app with SignJWT from JOSE. Everything works fine locally, it’s been tested over and over. However, in the production version deployed to Vercel, I find none of the auth functions work. None of them. I can’t login (making the entire app useless), can’t reset password, can’t create new account - it won’t do anything. The db is Postgres, also on Vercel (should be simple when everything is on Vercel, right…?).
Depending on the exact function, I typically see either a 500 or 404 error, often a POST error, or GET error. In general, trying to log in, I get a POST 500 error.
Given the database and storage are currently on Vercel, also, I would prefer not to tear this project apart and rebuild with a different database and storage platform, but I don’t understand what Vercel has done that renders this app useless.
I have loaded all environmental variables directly into Vercel. I have tried removing old ones, but the option to do so is grayed out (and I’ve disconnected everything from the project, as advised, so not sure why I can’t remove anything still). I don’t know how Vercel reads these, so don’t know if it’s part of the issue or not.
The errors are generic errors, and only point to the files in the auth folder for the specified action. So I have no further information about any of these errors.
A couple other notes, in trying to troubleshoot this, as mentioned I had to disconnect things from the project. I’ve reconnected GitHub and the Postgres db, however my Blob seems to just have disappeared. I don’t know why it doesn’t show ANYWHERE now, as I only disconnected it and never deleted anything. Also, it seems some of the env variables can be removed now, but only the ones I copied and saved last night in trying to fix this. Yet they are connected. The other ones should NOT be connected, yet have Remove grayed out. Seems backwards. I do what Vercel says I need to do, and then the opposite happens…
I really need help getting this to function properly. I don’t understand why everything works perfectly locally, but as soon as I visit the Vercel deployment, it’s so screwed up I can’t even login to do any further testing.
Framework: Next.js
Authentication: Custom JWT with JOSE
Node v20
Not sure if there’s anything else I should include here, but happy to reply to any further questions. Thank you!