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
Returning undefined from discoverOAuthMetadata for CORS errors (#717)
* Returning undefined from `discoverOAuthMetadata` for CORS errors
This behaviour was already happening for the root URL, but the new `fetchWithCorsRetry` logic differed.
The issue was if the server returns a 404 for `/.well-known/oauth-authorization-server/xyz` that didn't have the `access-control-allow-origin`, a TypeError was being thrown. There was logic there already to handle a TypeError for a _preflight_ request (cause by custom headers), but not the fallback. I refactored so all combinations return `undefined`.
* Add test for CORS error handling that should return undefined
This test covers the scenario where both the initial request with headers
and the retry without headers fail with CORS TypeErrors. The desired
behavior is to return undefined instead of throwing.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix test comment
---------
Co-authored-by: Glen Maddern <[email protected]>
Co-authored-by: Paul Carleton <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Paul Carleton <[email protected]>
0 commit comments