Skip to content

fix(auth): refresh the token on INVALID_TOKEN as well as EXPIRED_TOKEN - #184

Closed
manan164 wants to merge 1 commit into
mainfrom
fix/refresh-on-invalid-token
Closed

manan164 wants to merge 1 commit into
mainfrom
fix/refresh-on-invalid-token

Conversation

@manan164

Copy link
Copy Markdown
Collaborator

On a 401 the client only refreshed its token when the server said EXPIRED_TOKEN. In a multi-region setup each server signs tokens with its own secret, so after a failover the client's token is rejected with 401 INVALID_TOKEN; the client never refreshed and every call failed until restart. Java, Python, JS and Ruby already refresh on either code.

Now both codes trigger one refresh-and-retry (still bounded by MAX_TOKEN_REFRESH_RETRY_COUNT). Also guards a 401 body without an error field, which used to throw a NullReferenceException.

@manan164

Copy link
Copy Markdown
Collaborator Author

Closing this since #185 is better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant