Comments (7)
Hi @thomergil, thanks for submitting the issue.
Yes I'm aware that skipWhileRefreshing: false
is required and I plan to change it as soon as possible in the v3 of the library.
Please, understand this is something I do in my free time while I'm working on other projects/libraries. If you'd like to fast-forward the development process, please consider contributing if that's something you'd be able to do. I'd be more than happy to do a code review & accept any pull requests on this package.
When it comes to the documentation, there's no return
statement because of how the arrow functions work. When only one statement is executed and there's no wrapping curly braces {}
the statement will be returned automatically. Although it's correct, I agree that the function can be written in {}
and return the statement, so the people seeing it will actually realise that the return is necessary for the library to work.
from axios-auth-refresh.
I plan to include this change in v3.0.0 [PR #105].
from axios-auth-refresh.
I agree with @thomergil because I am faced with the same error. I resolved it only after reading this issue.
from axios-auth-refresh.
@SerhiyRomanov me too
from axios-auth-refresh.
I was a bit confused by the statement in the initial message:
Secondly, documentation is unclear. It needs to mention that refreshAuthLogic needs to return the axios instance:
It seems to me, that refreshAuthLogic
should return Promise
, not the axios instance (at least, that's what I got from the docs, and that's what I'm doing currently and it seems to work).
If my assumption is true, please confirm, that it's ok to return simple Promise
from that method :)
from axios-auth-refresh.
@Shaddix yes, you're right. It's enough to return any Promise, which triggers the stalled requests to run once again.
I think what author meant was that the example in documentation uses an arrow function to return the axios call (not instance) and there's no return
statement, which might be confusing for some people.
from axios-auth-refresh.
Done, merged and published in #111.
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.