I have no idea why this happened in prod but not locally.
For the record, logging in as an already existing user worked fine.
But when loggin in as a new user, the response was bad gateway,
something our own login handler would never respond with.
Meaning that, the request wouldn't even reach the handler?
But how could the router know which users already exist in the
database and which don't? Truly a mistery.
Separating the frontend routes from the api routes cleanly
seems to have fixed the problem. Something must've caused the router
to send the request to the frontend router instead of the login
handler.
I have no idea why this happened in prod but not locally.
For the record, logging in as an already existing user worked fine. But when loggin in as a new user, the response was bad gateway, something our own login handler would never respond with. Meaning that, the request wouldn't even reach the handler?
But how could the router know which users already exist in the database and which don't? Truly a mistery.
Separating the frontend routes from the api routes cleanly seems to have fixed the problem. Something must've caused the router to send the request to the frontend router instead of the login handler.