-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add ability to disable interceptor for specific calls #16
Comments
I am actually having an issue which I believe could be resolved with this. My refresh logic itself issues a request using Unless I am missing something? It seems this would be a pretty common issue but I don't see any reports of it. |
@krixon Wow, you surprised me... this should not be happening at all. Did you try it on the current master? Would you be able to reproduce and share the issue? Thanks. |
Fixed in #27. Please, give it a try before I publish it as latest release (it's in beta now).
|
Just to confirm, I also ran into this (what @krixon) described. Maybe @krixon is using some Promise/async flow to retrieve the refresh token, before sending the refresh request... I am using your interceptor to ask the user for a Authenticator one time password via a Quasar Dialog. If the dialog is submittted (not canceled), I try sending a request to laravel to verify the OTP, but the request is stuck in the request queue interceptor. The code works for everyone else, because they synchronously send the refresh request before adding the request interceptors (only the response is asynchronous). Probably I need to base my own interceptor on your wonderful work. Thank you in any case! Edit: |
Sorry for the late reply.
This is what I did in the end as I had to move on quickly. I added the ability to provide a whitelist of endpoint uri patterns and avoided queueing matching requests, which is pretty simplistic but enough for my use case. |
@krixon in This should also work for you @LeoniePhiline if I understand your issue correctly, just add the property to the call that shouldn't be queued (well... it won't be intercepted at all if it's not a problem). You can find more about it in Beta Readme. PS: You might need to check the lockfile for the axios version as the the request object is messed up a little in v0.19 of axios and there's no fix yet. In case you use 0.19, please roll back to 0.18 for a while until they fix it. The problem is that in 0.19 they don't preserve the request object structure (they reset it), so the property |
It would be nice to add the ability to disable interceptor for some of the requests. Right now this is only possible by using multiple instances of the axios. After a discussion with axios contributors we know it's possible to add your own properties to the requests' configuration which would enable us to do that.
The text was updated successfully, but these errors were encountered: