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
[2.x] Skip interceptor on specific endpoints #41
Comments
There's an option to skip interceptor for specific calls, isn't it an option for you? It's in beta now, but after your great work with contributions I guess you're already working on a beta. EDIT: I saw your comment in previous issue, that it breaks SRP, but well... the package strongly depends on axios and right now there's no other option I have in mind. Also, I don't think endpoint matching is a good thing as it can create multiple bugs in one's configuration which wouldn't be obvious then. I don't want people to hate this package because of those "global" settings no one really knows about except the developer who wrote it. |
Ah, sorry, I've missed this new feature. It should be enough: export const postLogout = () => (
httpClient.post('/logout', {}, {
skipAuthRefresh: true,
})
); That solution is even better! Thank you for the handy script! |
Reopened issue because I found that |
@antonkomarev aren't you using axios@0.19? Axios team changed behavior of custom properties in 0.19 and we're waiting for the fix. See axios#2295 |
Yes. Axios 0.19 :( |
I've installed 0.18.1 and it's working well. |
I faced the situation that on failed login action server respond with
401
error additional informationerror: "invalid_credentials"
but interceptor started to refresh token because it treats all401
errors as expired token. It will be good to have mechanism to exclude interception of the specific endpoints.I've thought about this syntax:
This implementation will have issues with ignoring endpoints like
PATCH /products/104
because it will require to add wildcards support and it will bring too much complexity to the package.The text was updated successfully, but these errors were encountered: