supabase-js
supabase-js copied to clipboard
fix: Improve authentication handling in fetchWithAuth.
🚀 What This PR Does
- Improves
fetchWithAuthby adding better error handling forgetAccessToken(). - Logs meaningful errors when retrieving an access token fails.
- Ensures API calls in Supabase SDK always have proper authentication headers.
🔧 Why This Is Important
- Prevents silent failures in authentication.
- Improves debugging experience for developers using Supabase SDK.
✅ How to Test
- Run Supabase SDK in a Node.js and browser environment.
- Intentionally break
getAccessToken()to verify error logging.
Would love feedback from maintainers! 🚀