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
I'm using a custom axios client to initialize OpenFgaClient, because our code runs in a VPC and requests need to go through proxy.
I found out that "credentails" are using default axios client, so it's unusable in our case.
Not sure if this is a bug or a feature requests, but it seems reasonable that the axios instance provided will be used for all requests.
It should be using this.axios.
Further, the SDK calls Credentials.init, so it never sets the axios instance https://github.com/openfga/js-sdk/blob/main/base.ts#L51
I guess you could just add an extra parameter for init with axios.
If needed I can make a PR, but you will be a lot faster than me.
Expectation
Axios client provided should be used for all requests, including getting access token.
Reproduction
Initialize the SDK with custom axios instance with e.g. logging interceptor.
Make any call e.g. check
See that the interceptor is not called for refreshing access token
OpenFGA SDK version
0.7.0
OpenFGA version
Auth0 FGA, not sure what version is that
SDK Configuration
With a custom axios client
Logs
No response
References
No response
The text was updated successfully, but these errors were encountered:
@wassil thank you for the bug report - we'll be taking a look at this at some point in the new year. However you don't have to wait; if you're willing to submit a PR, we'll gladly review it
Checklist
Description
I'm using a custom axios client to initialize
OpenFgaClient
, because our code runs in a VPC and requests need to go through proxy.I found out that "credentails" are using default axios client, so it's unusable in our case.
Not sure if this is a bug or a feature requests, but it seems reasonable that the axios instance provided will be used for all requests.
To be exact, function refreshAccessToken:
js-sdk/credentials/credentials.ts
Line 158 in 35c3ab5
It should be using
this.axios
.Further, the SDK calls
Credentials.init
, so it never sets the axios instance https://github.com/openfga/js-sdk/blob/main/base.ts#L51I guess you could just add an extra parameter for init with axios.
If needed I can make a PR, but you will be a lot faster than me.
Expectation
Axios client provided should be used for all requests, including getting access token.
Reproduction
OpenFGA SDK version
0.7.0
OpenFGA version
Auth0 FGA, not sure what version is that
SDK Configuration
With a custom axios client
Logs
No response
References
No response
The text was updated successfully, but these errors were encountered: