Comments (6)
As I said earlier, I'm not sure if that's a bug or desired behavior. Either way, it feels like it shouldn't be like that, so it might be worth opening the issue and see what axios team has to say about it.
If you do so, please, refer to this issue, so anyone with the same problem can see the thread.
Thanks.
from axios-auth-refresh.
Resetting the baseURL
works for the initial failing request but queued requests have the same issue and there is currently no solution to adjust those.
IMHO there should be a global baseURL
handling or a config option to define a callback for queued requests to be able transform their configs too.
from axios-auth-refresh.
Hi. Thanks for the issue.
Can you please share your code for the interceptor and other things associated with it (like the actual call, other interceptors, etc.) ?
from axios-auth-refresh.
I followed the docs exactly and don't have any other interceptors.
I removed the baseURL
of /api
from axios.create
and prefixed all my axios calls with /api
to see what happened and the problem went away, so I'm almost certain it's your library.
from axios-auth-refresh.
Inside your refreshAuthLogic
callback, just unset the baseURL. Unfortunately, this is a problem with axios (not sure if that's the problem or desired behavior). I can't find the source I know it from, but here's the actual implementation I did when I was explaining the library a bit. StackOverflow answer.
The thing is, url in axios' error config is the full url and the config still has the baseURL
option set.
I didn't want to change this, as this should be "just an interceptor" and I don't want people to get confused. Please, let me know if that helped.
Thanks
from axios-auth-refresh.
Hrm... that feels terrible hacky but it is a solution so I'll bear it in mind, thanks.
Think it's worth an issue on the axios tracker? I'm not really sure I know enough about either library to be the one to file it though.
Thanks for the responses!
from axios-auth-refresh.
Related Issues (20)
- should refresh HOT 2
- response.use will enter twice when retry HOT 2
- Implementation example HOT 1
- onRetry never firing HOT 5
- How to handle a 401 "Refresh token is invalid" error HOT 2
- Request is not being re-triggered after re-auth HOT 2
- Document whether all interceptors are rerun after refresh HOT 1
- Each call is getting duplicated HOT 1
- Interceptors fail to assign new token on second failure HOT 2
- Docs: Provide example for server-side axios requests nuxt HOT 1
- multiple axios instance. don't need to reqeuest refresh api multiple times
- Retry of the original request fails only if GET request HOT 4
- Axios auth refresh doesn't work with axios v1.1.3 HOT 7
- Resend request with multipart/formdata
- async shouldRefresh
- combine refresh token logic with another axios response interceptor
- Multiple Request Pause is not working HOT 2
- import('axios-auth-refresh') wraped with default HOT 2
- Problem using axios-auth-refresh with react-query HOT 2
- React Native 0.72.1 ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axios-auth-refresh.