refreshAuthLogic is not recalled on a second failure
See original GitHub issueAssume that you are making a request which returns a 401.
refreshAuthLogic
will be called as it should and this second request is returning again a 401.
This second failure is not triggering refreshAuthLogic
again, is this intentional?
Is there any way to re-trigger the callback?
My scenario goes as follows: A web application is utilizing the UMA flow which uses RPT Tokens to access resources. RPT tokens are cached and they may expire. On expiration a 401 is issued and I retry using a normal access token which will respond (again) with a 401 and a permission ticket which in turn will be exchanged for a new RPT token. So the scenario is request -> 401 -> request again -> 401 -> request again -> possibly 200
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:17 (3 by maintainers)
Top Results From Across the Web
@blueberry6401/axios-auth-refresh - npm
All the new requests created while the refreshAuthLogic has been processing will be bound onto the Promise returned from the refreshAuthLogic ...
Read more >Trying to get axios-auth-refresh working with NodeJS
As far as I can tell, the refreshAuthLogic function is working properly (because it returns a new auth token), but everything stops after...
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 had the same problem, and solution provided by @CteixeiraPW seems to work; In my code I made this change.
Before
After
I think it was because I set
pauseInstanceWhileRefreshing
to true but if I remove it, the second request is sent with the old token