Engineering Notes

Updating Google OAuth and Supabase for New Domains

By Ginbok2 min read

When migrating an application to a new domain, such as transitioning to erp.ginbok.com, updating your authentication providers is critical. If the handshake between Google OAuth and Supabase isn't synchronized with your new URL, users will face "mismatch URL" security blocks. Here is the technical workflow to ensure a seamless transition.

1. Supabase Dashboard Configuration

Supabase acts as the intermediary between Google and your application. You must update its internal routing to recognize the new origin.

2. Google Cloud Console Adjustments

Google requires explicit authorization for any domain requesting identity tokens. Access your API & Services > Credentials and select your OAuth 2.0 Client ID.

3. Environment Variables (Secrets)

Finally, update the application logic to use the new base URL for generating absolute paths.

# In your .env file or Cloud Secret Manager
APP_URL=https://erp.ginbok.com

Strategic Insights

Always perform these updates in a coordinated manner. Updating the Google Console before Supabase might lead to a brief window where the "Origin" header sent by the client is rejected. Furthermore, ensure that your SSL certificate for the new domain is active, as both Google and Supabase strictly enforce HTTPS for OAuth flows.

#backend#security#workflow
← Back to Articles
Updating Google OAuth and Supabase for New Domains - Ginbok