Web Development
Application Development
UI/UX Design
DevOps Consulting
Cloud Services
Blockchain Development
QA & Testing
Support & Maintenance
Ecommerce
Fintech
Real Estate
Healthcare
Logistics
Education
Fitness
Travels & Hospitality
73, Swashray Soc, Diwali Baug, Athwa Gate, Surat- 395001,
Guj- Bharat.
Back to Articles
BotNET IT Team
July 12, 2025
5 min read
Support tickets Friday afternoon: "Can't log in with Google." Error: redirect_uri_mismatch.
We moved from HTTP to HTTPS in production. Updated the redirect URI in code but forgot to update the Google Cloud Console OAuth settings.
Our load balancer terminates SSL. The app saw incoming requests as HTTP and built HTTP redirect URIs. Google rejected them because we registered HTTPS only.
const redirectUri = process.env.NODE_ENV === 'production'
? 'https://app.example.com/auth/callback'
: `${req.protocol}://${req.get('host')}/auth/callback`;
Better: move all redirect URIs to environment variables. One config per environment, no hardcoding.
OAuth errors tell you what's wrong, not why. Always update both code and provider settings. Infrastructure changes what your app sees—never assume request protocol matches deployment.
Tags: