(edited)
Problem
Updated cookie values are not retrieved within the same execution context, causing queued requests to fail.
Current Behavior
- At first, the
accessTokenfails. - The call for
refreshTokentriggers, and in its response, we get the newaccessTokenandrefreshToken. - The original request triggers again with the new
accessTokenand succeeds. - But the remaining requests in the queue, when they initiate, use the old token and fail with
401. - Again, the call for refresh triggers and fails with
400.
In my Axios setup, I am injecting the accessToken from cookies. I think from there, the queued requests use the old token.