The interceptor did not take effect when I refreshed the page
See original GitHub issueSummary
I wrote an interceptor in my Vue project,it works normally when the page is not refreshed.When I refresh the page,the request was sended, but the interceptor did not take effect,but at this time I switch the route, and it works again
Context
this is my interceptor ,i used vue-router in my Vue project,
axios.interceptors.request.use( config => { console.log(1); return config; }, error => { console.log(2); return Promise.reject(error); } );
- axios version: e.g.: v0.16.0
- Environment: *e.g.: node v8.7.0, chrome 64, windows 7,vue 2.9.6
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Interceptor not executed when I refresh my page using ...
I am using JWT Authentication(Spring Boot Security) and on each click my interceptor is called to set the token before the request is...
Read more >Top 10 ways to use Interceptors in Angular - Medium
My ten favorite ways to use the interceptor in Angular. With examples of error handling, profiling, caching and more this list will inspire...
Read more >Angular Authentication part - 2 (Handling refresh token + Http ...
It will explain how to handle refresh token in angular application also redirecting to login page if the token is invalid or expired...
Read more >Single-page application: Acquire a token to call an API
If no access token is found or the access token found has expired, it attempts to use its refresh token to get a...
Read more >Angular 12 Refresh Token with Interceptor and JWT example
How to handle token expiration in Angular 12 - refresh Token before expiration using Http Interceptor 401 - silent refresh JWT token ...
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 FreeTop 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
Top GitHub Comments
I’m running into the same issue,
axios.interceptors.request.use
just doesn’t get used in 0.18.xI moved it from a global interceptor to an instance interceptor and that worked for me.
Closed due to lack of enough information.