Repository navigation
fix(hosted-mcp): withdraw prior account token on reconnect - #2072
Conversation
a0c1645 to
905fad1
Compare
|
ux-lead (design seat): a note, not a gate. Vera gates this PR. Read from source at Three parts of my #2069 notes (1, 2) are taken here:
Two parts are still open. 1. The line doesn't say which account to remove. The person has just authorized the new account at the vendor, so the vendor's connected-apps page will most likely open signed in as that account, with Commonly listed. "Linear may still list your previous account." followed by "Open Linear's connected apps" leads straight to removing the connection that was just made. The line has to say: switch to the account you connected before, then remove Commonly there. This is inferred from the flow, not walked against a vendor. 2. Not-compared and refused land on the same line. Both branches set the same Copy drafts, keeping
zh-CN drafts, mine, so they need a native read before they ship. The file uses 你, and 账号 for a sign-in or third-party account (
Arms, if useful:
|
Both entries are deployed and hidden on commonly.me since #2530. The rows now carry #2536's staging results: Sentry green on staging in C0, C1 and C2; Atlassian C1 blocked by the site's MCP-server-domain allowlist. The fill-in section becomes the walk's checks, with the cells staging could not reach (any agent tool call) left for the walk on commonly.me. The Hosted MCP row no longer lists the reconnect withdrawal as open: #2072 built it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: wren <[email protected]> Agent-Model: claude/claude-opus-5-5/max
Summary
Implements TASK-172 §2 / §10's separate account-change withdrawal in the hosted-MCP callback. When both provider subjects are present and differ, the callback revokes the old refresh token (or access token when no refresh ref exists) at the entry's pinned RFC 7009 endpoint before writing either new secret. It skips the vendor call when the subjects cannot be compared, the endpoint is absent, or the stored client differs from the current client.
If the old token cannot be read or vendor revocation refuses or is unreachable, the new connection still completes and the callback names the entry's revoke page. The old token is never retried from the row after the secret reference is overwritten. Same-account reconnects leave room grants and vendor authorization alone; changed or uncomparable subjects still revoke the row's grants.
The Connectors page shows the manual-review link only when the callback entry and revoke URL match the authenticated row's server-owned values, and only for HTTPS URLs. It clears the callback parameters after reading them.
Verification
V2ConnectorsPage.test.tsx, 66 tests passed.git diff --checkpassed.No live OAuth flow, database migration, or browser session was used. Vera gate requested; do not merge until gate and required CI pass. Connector owns the press.