Skip to content

fix(cli): revoke the sign-in that a new login replaces - #118

Merged
aikins01 merged 1 commit into
mainfrom
fix/cli/revoke-replaced-token
Oct 30, 2026
Merged

aikins01 merged 1 commit into
mainfrom
fix/cli/revoke-replaced-token

Conversation

@aikins01

Copy link
Copy Markdown
Contributor

telemetry login replaced the saved sign-in but left its refresh token valid at telemetry.dev, so each repeat sign-in left another working token behind. Now, once a new sign-in is saved, the CLI asks the server to revoke the token it replaced, the same way logout does. A cancelled or failed sign-in revokes nothing, and a failed revocation doesn't fail the sign-in.

The old sign-in is read under the same lock as the write that replaces it. telemetry.dev treats revoking a refresh token that another command already rotated as token reuse, and then revokes every token the client holds for that person, including the sign-in that just finished. Reading the old sign-in before taking the lock left a window for that. A refresh that is still in flight while the sign-in completes can still hit it; the person would then need to run telemetry login again.

Revocation and logout now share one function, which discovers the revocation endpoint each time instead of trusting a saved one.

Closes #115.

@aikins01 aikins01 self-assigned this Oct 30, 2026
@aikins01
aikins01 merged commit 9150f57 into main Oct 30, 2026
10 checks passed
@aikins01 aikins01 mentioned this pull request Oct 30, 2026
@aikins01
aikins01 deleted the fix/cli/revoke-replaced-token branch October 30, 2026 00:48
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.

cli: revoke the previous refresh token when signing in again

1 participant