-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is Axios interceptors available through Typesense.Client? #223
Comments
There is no way to pass interceptors to the axios instance used by typesense-js. However, you should be able to use global interceptors as described here: https://axios-http.com/docs/interceptors |
Thanks for the reply! I've tried this, but from what I've read, I don't think global interceptors are automatically copied over when a new Axios-instance is created. I can't seem to get them registered within the TypeSense Axios-instance at least. |
Description
I’m working on using typesense-js in a Nuxt application, and I have the goal to manage access to my data by rotating and scoping API-keys through my backend with a fixed ttl. But I'm looking for a way to easily capture any old keys and refreshing them by looking for 401-exceptions through the API. Since you’re using axios I assumed I could use Axios interceptors in a way, but looking through the code i cant seem to find a way to do that. Am I missing something, or is there actually no way to pass interceptors down to the Axios client inside Typesense.Client?
Expected Behavior
A way to pass Axios Interceptors through the Typesense Client.
Actual Behavior
There seem to be no way to pass down Axios Interceptors through the Typesense Client.
The text was updated successfully, but these errors were encountered: