© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4d ago•
9 replies
Kamkom

Issue with signInWithOAuth() using multiple branches (prod vs staging)

🟢SSR🌲branchingauth
Hello everyone,

I’ve been struggling to get signInWithOAuth() working correctly with multiple branches.
I have a main (production) branch and a persistent staging branch. Google and Apple authentication work perfectly on both web and mobile in staging, but in production it consistently fails.
I’ve double-checked all configurations:
- Apple & Google OAuth setup
- Supabase URL and redirect settings
- Environment-specific configuration for both staging and production

However, one issue remains.

When logging in from my Next.js app using signInWithOAuth() with redirectTo, the payload sent by Supabase to Google/Apple is incorrect. While the redirectTo value is correct for each environment, the client_id and redirect_uri are always those of the QA/staging environment, even though they are configured differently for production.
This happens systematically, which makes me suspect a bug or unexpected behavior in signInWithOAuth() when using multiple branches/environments.
Has anyone encountered this before or knows how to fix it?
These two parameters are directly set by supabase when calling the /authorize endpoint, I dont have a hand on them.
Thanks a lot for your help.
Younes
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Update scopes using signInWithOAuth?
SupabaseSSupabase / help-and-questions
12mo ago
signInWithOAuth - differentiate sign in vs sign up?
SupabaseSSupabase / help-and-questions
3y ago
How can I setup auth redirects to work for multiple (local, staging, prod) environments?
SupabaseSSupabase / help-and-questions
4y ago
facebook signInWithOAuth help
SupabaseSSupabase / help-and-questions
5mo ago