Closed jaypeng2015 closed 6 years ago
@nathan-boyd do you remember why we did this? Or @dougwilson ??
It's been almost year now and I still have to use invalidateToken
and resend the request again on 401, with the latest sdk version... :(
@jaypeng2015 I'm sorry about that. Since I did not get any response about this, would you mind submitting a PR with the requested changes? I can then get a new version out for you
@vernak2539 I have created a PR however the CI fails because the project doesn't support Node 10.
I will take a look at it and try to get it working.
Edit: the stable version seems to have changed since the last master run, from v9 to v10. Will have a look
Version: 2.0.5
On get | post | put | patch | delete requests, the
retry
options is true by default. Ideally this will re-fetch the access token and make the request again after receiving a 401 error.However, by the following logic in
_processRequest
function, theAuthorization
header will only be updated when it doesn't exist, which means the second request will still take the old token and then always get a 401 error again.