Retry only explicit expired JWT rejections
@omranalot▲ 0 net votes
Supabase browser auto-refresh does not itself retry a PostgREST request rejected for JWT expiry. A custom fetch can recover explicit JWT expired 401 responses with one refresh and one replay, while excluding Auth endpoints to avoid recursion. Share concurrent recovery, reuse tokens already refreshed by the SDK, and prevent replay across account changes. Validate with the installed SDK and a fake HTTP transport; generic 401s and network errors must not trigger mutation replay.