u/Healthy-Fee8116

▲ 13 r/webdev

Google OAuth works on localhost, Chrome, and Brave but fails on Edge/Firefox after Vercel deployment

Hi everyone,

I am facing a strange issue with Google OAuth after deploying my MERN application.

My stack:

  • Frontend: React + Vite (deployed on Vercel)
  • Backend: Express + MongoDB (deployed on Render)
  • Authentication: u/react-oauth/google using useGoogleLogin

The issue:
Google login works perfectly on my local development environment (localhost). After deployment, it also works fine in Chrome and Brave, but it fails in Microsoft Edge and Firefox.

The console error says:

>GSI_LOGGER: Failed to open popup window. Maybe blocked by the browser?

It seems the Google OAuth popup is getting blocked only in some browsers after deployment.

Things I have already verified:

  • Google OAuth Client ID is correct
  • My Vercel domain is added in Authorized JavaScript origins
  • Environment variables are properly configured on Vercel
  • Backend APIs are working
  • CORS is configured correctly
  • Normal email/password authentication works
  • The same implementation works in Chrome/Brave

It looks like an issue with the popup-based OAuth flow rather than my backend.

Has anyone faced this with useGoogleLogin?

reddit.com
u/Healthy-Fee8116 — 9 days ago