Google auth deployment on fly
I have been having some issues with getting google auth working on fly deployments, it was working locally, now when I test locally I get to see the login screen but when I login with google it just hangs, when I go to my online version I dont even get to see the login screen.
I have set the WASP_SERVER_URL to my fly.dev url
and the WASP_CLIENT_URL to my custom domain name
I have set these both in my .env aswell as usting flyctl set secrets
Does anyone know what still could be going wrong? It is difficult to debug as I do not know where to look the window just hangs and I do not see anything in the console, should I be looking someplace else?
3 Replies
Hi @BeReal. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, there are a few things you can check to troubleshoot your Google Auth deployment issues on Fly.io:
1. Google OAuth App Configuration:
Make sure you've properly set up your Google OAuth app as described in Setting up Google Auth (https://wasp-lang.dev/docs/auth/social-auth/google#3-creating-a-google-oauth-app). Specifically, check that you've added the correct Authorized redirect URIs for both your local development and production environments:
- For local:
<http://localhost:3001/auth/google/callback
>
- For production: <https://your-server-url.fly.dev/auth/google/callback
>
2. Environment Variables:
Ensure you've set the following environment variables correctly:
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- WASP_WEB_CLIENT_URL
- WASP_SERVER_URL
- JWT_SECRET
(if using Wasp Auth)
You mentioned setting these in both your .env
file and using flyctl set secrets
. The Fly.io secrets should take precedence, but double-check that they're set correctly using flyctl secrets list
.
3. Server Logs:
Since you're not seeing anything in the console, check the server logs on Fly.io. You can do this by running:
This might give you more insight into what's happening on the server side.
4. CORS Configuration:
Make sure your WASP_WEB_CLIENT_URL
is set correctly to your custom domain. If there's a mismatch, you might encounter CORS errors.
5. Wasp Version:
Ensure you're using the latest version of Wasp. There have been updates that fixed similar issues in the past. You can update Wasp and redeploy your app as suggested in the Discord thread (https://discord.com/channels/686873244791210014/1201898985300971540):
Then update the Wasp version in your main.wasp
file and redeploy:
6. Database Check:
If you've previously used email authentication with the same email address you're trying to use for Google Auth, there might be a conflict. You can check your database using wasp db studio
and delete any conflicting user entries.
If none of these steps resolve the issue, you might need to provide more specific error messages or logs for further debugging. The hanging behavior you're experiencing could be due to various factors, and more detailed error information would be helpful for pinpointing the exact cause.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @BeReal, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?when I go to my online version I dont even get to see the login screen.Do you see any errors in the browser console? Do you see any errors in the server logs on Fly?
@miho thanks for your reply, it was something silly, there was an error in my server deployment so it wasn't even running I was too focused on the auth thing to notice,