Skip to content

fix: revoke OAuth tokens independently so one failure does not skip the other - #67

Closed
Ashutosh0x wants to merge 1 commit into
cloudflare:mainfrom
Ashutosh0x:fix/revoke-tokens-independently
Closed

fix: revoke OAuth tokens independently so one failure does not skip the other#67
Ashutosh0x wants to merge 1 commit into
cloudflare:mainfrom
Ashutosh0x:fix/revoke-tokens-independently

Conversation

@Ashutosh0x

Copy link
Copy Markdown

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

…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
@Ashutosh0x

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@kentonv

kentonv commented Aug 7, 2026

Copy link
Copy Markdown
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?

@kentonv kentonv closed this Aug 7, 2026
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.

Disconnecting an MCP account can leave its refresh token live at the authorization server

2 participants