Closed gabriel-le closed 3 months ago
It uses the global fetch function, so you could override it globally.
let originalFetch = globalThis.fetch;
globalThis.fetch = newFetchCompatibleWithProxy;
Also a fetch
call only happens once in the code, here https://github.com/sergiodxa/remix-auth-oauth2/blob/593e397df11d3678fa4ad02935b44316ad2e5259/src/index.ts#L416-L420, and fetchAccessToken
(the method where that happens) is marked as protected, so if you create a sub-class of OAuth2Strategy you could override fetchAccessToken
to provide your own version using a fetch compatible with a proxy.
Good to know, thanks for the tip!
The authentication process times out when the server is behind a proxy.
A possible fix would be to let developers override the fetch function and provide their own.