newsiberian / apollo-link-token-refresh

Apollo Link that performs access tokens (JWT) renew
MIT License
337 stars 45 forks source link

Don't process queue if refresh token request fails #63

Closed piyushk96 closed 4 months ago

piyushk96 commented 4 months ago

As the title suggests the queue should not be consumed if the refresh token request fails for some reason instead the queue should be flushed. This is because if the refresh token request fails and we try to consume the pending requests then these requests will be fired with the old (expired) token and this is unnecessary network overhead as all these requests are eventually going to be rejected by the server because of the expired token.