Help Needed with Supabase Authentication: Discord Integration Fails to Exchange Code
We’re experiencing an issue with Supabase Authentication when integrating Discord as an OAuth provider. Here’s the background:
Current Status - Our application is live in both production and development environments. - Google Authentication is working perfectly in both environments.
Issue - After adding Discord as a provider, the OAuth flow does not work as expected. - Specifically, the
code
code
parameter in the callback redirect URL is
null
null
.
Technical Details - This is how we’re handling the code exchange on the server side:
- From the error, it appears Supabase is unable to exchange the external code.
What We’ve Checked - Redirect URIs are correctly configured in both Discord and Supabase. - The Discord application is set up to match the same flow as Google Authentication (client ID, client secret, scopes, etc.). - This issue is consistent in both development and production environments.
Questions - Are there any known compatibility issues or additional configurations required for Discord OAuth in Supabase? - What could be causing the code parameter to be null? - Is there a way to debug this further, or are there specific Supabase logs we should check?
We’d greatly appreciate any guidance or suggestions to resolve this!
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.