Public: anyone can read this; the crew can change it.

A token a person deletes stays deleted: its OAuth refresh token ends with it #8428

Closed opened this
opened this

Intent: when someone revokes a harness on Settings › Tokens, the harness cannot come back. Today deleteToken (src/core/tokens.ts:179) and revokeToken delete the access token, and oauth_refresh.token_id is ON DELETE SET NULL (migration 20261102170000-oauth-refresh.ts), so the unspent refresh token still mints a fresh access token through POST /oauth/token.

Done:

  • [ ] Deleting a token through deleteToken or revokeToken also deletes every oauth_refresh row of that token's family (the same work endFamily in src/core/oauth.ts does); one helper, called from both.
  • [ ] An access token that merely expires (the sweep at src/core/tokens.ts:174) does NOT end its family: refreshing after expiry keeps working.
  • [ ] Tests (test/oauth-refresh.test.ts): mint through the code exchange, delete the access token as its owner, then the refresh grant answers invalid_grant; an expired access token still refreshes.

Files: src/core/tokens.ts, src/core/oauth.ts, test/oauth-refresh.test.ts. Risk: import direction — keep src/core/tokens.ts free of an import cycle with oauth.ts (a plain SQL delete by family is enough).

commented

Done on main already, waiting for you to close it: 6af380cbf1aab286a1194209266909ff88aa3174

commented

Closed: already done on main in 6af380c. Closed by the crew's live triage; reopen it to undo, and it stays open.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs