[2.x] Skip interceptor on specific endpoints
See original GitHub issueI faced the situation that on failed login action server respond with 401
error additional information error: "invalid_credentials"
but interceptor started to refresh token because it treats all 401
errors as expired token. It will be good to have mechanism to exclude interception of the specific endpoints.
I’ve thought about this syntax:
createAuthRefreshInterceptor(axios, refreshAccessToken, {
excludeEndpoints: {
'/login' : {'post'},
}
});
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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Angular interceptor exclude specific urls - Stack Overflow
With this being known my idea is to make 2 interceptors, the first will add the 1 header that they all use and...
Read more >How To Skip HTTP_INTERCEPTORS - Medium
There are two ways to two skip HTTP_INTERCEPTORS by (1) adding a flag to the header when requesting or (2) creating a new...
Read more >3 ways to use Angular HTTP Interceptors - Briebug Blog
Interceptors are capable of mutating requests and responses, the HttpRequest and HttpResponse instance properties are read-only, rendering them ...
Read more >Ignorable HttpClient Interceptors · Issue #20203 - GitHub
In current angular 5 implementation there is no elegant way to ignore particular http interceptor. Expected behavior. It would be nice to be ......
Read more >7 Ways to Leverage HttpInterceptors in Angular - Bits and Pieces
HttpInterceptor can be used to set an authorization header to the HTTP requests going to a particular domain. Authorization via HttpInterceptors ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve installed 0.18.1 and it’s working well.
@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