Modular Equity
← Back to Register

Google sign-in: "redirect_uri_mismatch"

Google compares the exact callback URL your app sends with the list in Google Cloud Console. If they don't match, you see Error 400: redirect_uri_mismatch.

1 · Add the callback in Google Cloud

In APIs & Services → Credentials, open your OAuth 2.0 Client ID (Web application). Under Authorized redirect URIs, add every URL users might use:

  • https://modularequity.com/api/auth/callback/google
  • Your Vercel default host, e.g. https://<project>.vercel.app/api/auth/callback/google
  • Local dev: http://localhost:3000/api/auth/callback/google

Under Authorized JavaScript origins, add the same hosts without the path (e.g. https://modularequity.com).

GoDaddy "lander" page (or `/lander` in the URL)?

If you land on a GoDaddy page with a URL like .../lander?code=...&scope=..., that is not from this app — we don't use /lander. Google sends the user to the Authorized redirect URI you saved in Google Cloud.

  • Wrong URI in Google: Remove any redirect URI that ends in /lander and add only https://modularequity.com/api/auth/callback/google (and your Vercel URL if needed).
  • DNS still at GoDaddy: If the domain doesn't point to Vercel yet, Google may hit a parking page instead of our app. Point the domain's DNS to Vercel and verify the domain in the Vercel dashboard until the site loads your dashboard, then retry Google sign-in.

2 · Match Vercel to your public domain

If people open modularequity.com but the app still builds OAuth links with a *.vercel.app host, Google will reject the request unless that preview URL is also listed.

In Vercel → Project → Settings → Environment Variables (Production), set one of these to your real site (no trailing slash):

  • AUTH_URL = https://modularequity.com
  • or NEXT_PUBLIC_APP_URL with the same value

Redeploy after changing env vars. The app also prefers a custom domain oververcel.app when both are present.

Developers: see docs/google-oauth.md in the repo for the full checklist.