-
-
Notifications
You must be signed in to change notification settings - Fork 395
Axios Interceptors #226
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
Comments
I think you currently cannot add axios interceptors since you don't have access to the actual axios instance that is created by code generated by this library (at least I didn't manage to do it). |
not a great solution, but you can override the i think it makes sense to pass an actual instance instead of an instance config. |
@orouz I just saw recent release with |
Wouldn't this change be reset back when you use |
@marko-hologram, You are right. it is always reseted, unless you can use custom templates, successively. I'm trying to use custom templates, but it is not work well. |
I just successed using template. make directory "templates" and and type below in terminal |
Oh yeah I didn't think about using custom templates for this. I used them for something else but forgot it can also be applied here. Good catch! Unfortunately this means you will have to keep this template updated as But at least there is a way to expose this AxiosInstance after all. |
I'll make |
Can we somehow inject the interceptor in the client kit itself as it is required for all api call? It not good idea to write the same interceptor code in all apis. |
Hello. Thanks for your great library.
Do you have good examples how to use axios interceptors (e.g. refresh token) for generated apis?
The text was updated successfully, but these errors were encountered: