-
Couldn't load subscription status.
- Fork 22
Description
Checklist
- I have looked into the README and have not found a suitable solution or answer.
- I have looked into the documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have upgraded to the latest version of OpenFGA and the issue still persists.
- I have searched the Slack community and have not found a suitable solution or answer.
- I agree to the terms within the OpenFGA Code of Conduct.
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
| }, globalAxios); |
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
- 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
Metadata
Metadata
Assignees
Labels
Type
Projects
Status