Help with Google OAuth
cod3break3r
FREEOP

6 months ago

I'm deploying an API with AdonisJS (Node.js) on Railway (free plan) and have implemented social login with Google OAuth. The flow works perfectly on my local environment, but in production (Railway) the Google callback does not work and results in a 499 error.

Does Railway's free plan block outgoing connections to Google OAuth endpoints? Has anyone else experienced this issue or knows if there are any outbound network restrictions on Railway for this use case?

Closed$10 Bounty

5 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


smolpaw
HOBBY

6 months ago

No it doesn't block requests to Google OAuth. Free plans have serverless mode enabled I think so if no network request is made for 10 minutes, the application is put on sleep.
Could this be the reason you are getting that error ?


smolpaw

No it doesn't block requests to Google OAuth. Free plans have serverless mode enabled I think so if no network request is made for 10 minutes, the application is put on sleep.Could this be the reason you are getting that error ?

cod3break3r
FREEOP

6 months ago

Everything in the API works well and responds immediately; the point of failure is when selecting the Google account to sign in.


smolpaw
HOBBY

6 months ago

Can you walk me through the exact OAuth step the error happens ?
Also do you know any basic debugging tools like checking the browser dev tools to find out what data is being sent to google to initiate OAuth, maybe there's issue with redirectURL or you haven't yet whitelisted your domain on GCP.


smolpaw

Can you walk me through the exact OAuth step the error happens ?Also do you know any basic debugging tools like checking the browser dev tools to find out what data is being sent to google to initiate OAuth, maybe there's issue with redirectURL or you haven't yet whitelisted your domain on GCP.

cod3break3r
FREEOP

6 months ago

Based on my debugging—if I remember correctly—the error seemed to be in this line of code:

allyUser = await ally.use('google').stateless().user()

I've now deployed the app on a different service and it's working without any issues, so I can confirm the problem is with Railway.


Status changed to Closed brody 7 months ago


Loading...