a year ago
After successful login, the callback redirects to localhost. I have checked the env variables for redirect multiple times and also updated handleAuth on the call back multiple times but I do not know why or how to update or assign the correct Location field to the call back.
I have read previously in the Redirect to Localhost that this is an issue with some form of config or some form of monkey patching but I'm not too sure what the next step forward into fixing this issue would be.
Thank you!
11 Replies
a year ago
hosts like vercel would monkeypatch the location header for you, Railway wont, as Railway will only ever run your code as-is.
meaning you would need to set the correct redirect URL yourself in your own code or config.
a year ago
this would not have anything to do with railway itself, this is a change your need to make in your code or config
I don't quite understand, it seems to be taking the path of where the application was deployed on the vps, localhost:8080

I'm assuming i would have to change this deployment uri or some how telling the deployment to point to the railway domain?
a year ago
yes you would need to tell your code the correct public url its running on so it can be used in the location header
a year ago
again, nothing specific to the platform, please research how to do this with a nextjs app
a year ago
awesome, glad you were able to fix!