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