Prompt

Google login callback not working after deploy

Technology / Identity & Access1 observationLast seen Oct 6, 2026

Latest observation

Oct 6, 2026OpenAI APIWeb search: off

This usually comes down to redirect URI / OAuth config mismatch between local and production.

Quick checklist

1) Verify the Google OAuth redirect URI in Google Cloud Console

In APIs & Services → Credentials → OAuth 2.0 Client IDs, make sure your Authorized redirect URI exactly matches your deployed callback URL, for example:

  • https://yourdomain.com/api/auth/callback/google
  • https://your-app.vercel.app/api/auth/callback/google

It must match exactly:

  • http vs https
  • domain
  • path
  • trailing slash
  • subdomain

2) Check your app’s redirect_uri / callback route

Make sure your app is generating the production callback URL correctly. If you’re using:

  • NextAuth / Auth.js: confirm NEXTAUTH_URL or AUTH_URL
  • Passport / custom OAuth: confirm the callback URL passed to Google is the production one

3) Set production env vars

Common issue: local env vars still point to localhost.

Examples:

  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • NEXTAUTH_URL=https://yourdomain.com
  • NEXTAUTH_SECRET=...

If using Auth.js v5, also check:

  • AUTH_URL
  • AUTH_TRUST_HOST=true (sometimes needed behind proxies/platforms)

4) Make sure your deploy platform forwards HTTPS correctly

If you’re behind a proxy/load balancer, your app may think it’s on http:// and generate the wrong callback URL.

5) Check Google Cloud Console “Authorized JavaScript origins”

If your flow needs it, add:

  • https://yourdomain.com

6) Inspect the exact error

Common Google errors:

  • redirect_uri_mismatch → callback URL mismatch
  • unauthorized_client → wrong client type or config
  • origin_mismatch → missing JS origin
  • access_denied → user denied consent or app verification issues

If you’re using NextAuth/Auth.js

Production issues are often fixed by:

NEXTAUTH_URL=https://yourdomain.com
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...

And in Google Console:

https://yourdomain.com/api/auth/callback/google

If you want, send me:

  1. The exact error message from Google
  2. Your callback URL route
  3. Whether you’re using NextAuth/Auth.js, Passport, or custom OAuth
  4. Your deploy platform (Vercel, Render, AWS, etc.)

…and I can tell you the exact fix.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as Circuit. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.