Skip to content

cli: logout must call POST /auth/revoke to revoke the token server-side (RFC-0001 R2 / §7.5) #112

Description

@saadqbal

Client half of the logout server-side-revoke gap — RFC-0001 §7.5 / R2. The backend endpoint now exists: POST /auth/revoke (tracebloc/backend#887, shipped in tracebloc/backend#903 — Bearer → 204, idempotent).

Why

The RFC-0001 connect-flow FR (2026-06-25) confirmed tracebloc logout is local-only: it clears ~/.tracebloc/config.json but a copied/leaked token still authenticates afterward (verified: back up token → logout → restore copy → client list still works). The CLI just needs to call the new endpoint.

Scope (contract)

On tracebloc logout:

  1. Read the stored Bearer token from the config store.
  2. POST <backend>/auth/revoke with Authorization: Bearer <token>.
  3. Tolerate failure gracefully — if the server call fails (offline / already-revoked / network), still clear local state; never leave the user unable to log out locally.
  4. Clear the local token/config as today.

Acceptance

  • After logout, a replayed copy of the old token is rejected server-side (→ 401).
  • logout still succeeds + clears local state when the backend is unreachable.

Pairs with cli#100 (both touch logout — can be done together). Refs: tracebloc/backend#887, tracebloc/backend#903, tracebloc/backend#830.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions