supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

fix: Improve authentication handling in fetchWithAuth.

Open anuragchvn-blip opened this issue 9 months ago • 0 comments

🚀 What This PR Does

  • Improves fetchWithAuth by adding better error handling for getAccessToken().
  • 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

  1. Run Supabase SDK in a Node.js and browser environment.
  2. Intentionally break getAccessToken() to verify error logging.

Would love feedback from maintainers! 🚀

anuragchvn-blip avatar Mar 05 '25 20:03 anuragchvn-blip