fix: revoke OAuth tokens independently so one failure does not skip the other - #67
Closed
Ashutosh0x wants to merge 1 commit into
Closed
fix: revoke OAuth tokens independently so one failure does not skip the other#67Ashutosh0x wants to merge 1 commit into
Ashutosh0x wants to merge 1 commit into
Conversation
…he other When disconnecting an MCP account, revoke each token in its own try/catch so a failed access-token revocation (e.g. unsupported_token_type per RFC 7009 §2.2.1, or a 503) does not skip the refresh-token revocation. Refresh token is revoked first per RFC 7009 §2.1. Fixes cloudflare#41
Author
|
I have read the CLA Document and I hereby sign the CLA |
Member
|
Hi @Ashutosh0x, Apologies but, per our contributing guide, we prefer not to receive external pull requests. We prefer instead to receive issue reports, which we can then direct our own agents to solve. Could you please file an issue instead? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #41
Problem
evoke()\ wraps both token revocations in a single \ ry, so if the access-token revocation fails (RFC 7009 §2.2.1 \unsupported_token_type, a 503, or a dropped connection), the refresh token is never presented for revocation — and \deleteAll()\ then removes it locally, making it unrevocable.
Fix
Revoke each token in its own \ ry/catch, refresh token first (per RFC 7009 §2.1, revoking the refresh token SHOULD also invalidate access tokens).
Minimal change — 13 insertions, 6 deletions.
cc @jonesphillip @kentonv