Skip to content

fix(hub): a refused refresh logs the upstream out - #405

Merged
7schmiede merged 1 commit into
mainfrom
fix/refused-refresh-logs-out
Nov 2, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/refused-refresh-logs-out

Conversation

@7schmiede

Copy link
Copy Markdown
Member

An OAuth upstream (seen with Linear) whose refresh token the authorization server refused kept its dead login in the keychain. logged_in only checks that a secret exists, so the dashboard showed logged in while every call failed with …/token refused: invalid_grant.

Now bearer() drops the login when the token endpoint refuses the refresh for good (RFC 6749 5.2: invalid_grant, invalid_client, unauthorized_client): the dashboard says logged out, and the agent gets the usual "not logged in … log in at ". A token endpoint that cannot be reached, or fails otherwise (5xx, other errors), changes nothing, so an outage logs no one out.

  • token_request tells a final refusal (Refused { gone }) from other failures
  • test a_refused_refresh_logs_out (unreachable endpoint keeps the login; revoked refresh token logs out)
  • docs/dashboard-api.md notes it at POST /hub/upstreams/call

No card: a bug fix, the meaning of logged_in is unchanged.

🤖 Generated with Claude Code

An OAuth upstream whose refresh token the server refused (invalid_grant,
invalid_client, unauthorized_client) kept its dead login in the keychain:
the dashboard showed it logged in while every call failed with the token
endpoint's error. Such a refusal now drops the login, so the dashboard says
logged out and the agent is sent to log in again. A token endpoint that
cannot be reached or fails otherwise changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 132daa0 into main Nov 2, 2026
@7schmiede
7schmiede deleted the fix/refused-refresh-logs-out branch November 2, 2026 09:28
@7schmiede 7schmiede mentioned this pull request Nov 2, 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.

1 participant