question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.x] Skip interceptor on specific endpoints

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
antonkomarevcommented, Nov 28, 2019

I’ve installed 0.18.1 and it’s working well.

1reaction
Flyrellcommented, Nov 28, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found