anythingmcp icon indicating copy to clipboard operation
anythingmcp copied to clipboard

Server-side dashboard sign-out and sign out of all devices

Open helpcodeai opened this issue 4 days ago • 0 comments

Signing out of the dashboard today only forgets the token in the browser: the token itself stays valid until it expires (24 hours). There is also no way for a user to end their sessions on other devices, short of changing the password.

Proposal:

  • POST /api/auth/logout ends the session that calls it: the token's id is recorded until the token would have expired, and dashboard routes and /mcp refuse it from then on. Connected AI apps and API keys are not affected.
  • POST /api/auth/logout-all ends every dashboard session of the user and every MCP sign-in made with the account (the same cutover a password change already applies). API keys keep working.
  • Dashboard tokens get a random jti.
  • A JWT presented to /mcp must be an MCP access token or a dashboard token; other token types signed with the same secret are refused. The dashboard API requires the dashboard token marker.
  • Settings → Profile gets a "Sign out of all devices" button.

Schema change: one new table, revoked_dashboard_tokens (jti primary key, user_id with cascade delete, expires_at, created_at), additive only. Expired rows are removed when a new row is written.

helpcodeai avatar Nov 30 '26 13:11 helpcodeai