You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: defer response body consumption; require onUnauthorized on OAuthClientProvider
Addresses two review comments from the second claude[bot] pass:
1. response.text() was called before passing response to
onUnauthorized(), so custom implementations calling
ctx.response.text()/.json() got empty results. Moved text()
consumption after the onUnauthorized branch in all three
401-handling sites — it's only needed for the fallthrough
error message.
2. onUnauthorized() was optional on OAuthClientProvider (inherited
from AuthProvider), but OAuth providers that omit it lose ALL
401 recovery — no token refresh, no redirect. The migration
docs said 'optional but recommended' which understates the
footgun. Now required on OAuthClientProvider (still optional on
base AuthProvider). TypeScript enforces at compile time; the
delegation to handleOAuthUnauthorized is a one-liner.
0 commit comments