windlass icon indicating copy to clipboard operation
windlass copied to clipboard

Let admins see and revoke other users' API tokens in Settings

Open Sulaiman-Dauda opened this issue 1 month ago • 0 comments

An admin can see and revoke another user's API tokens only through the API. GET /api/v1/users/{id}/tokens and DELETE /api/v1/users/{id}/tokens/{tokenID} exist in internal/api/users.go, but nothing in the panel calls them. They accept a session only, not a token, so the panel is the natural place for them.

It matters when an account may be compromised. docs/api.md tells the reader to revoke its tokens in Settings, which today works only for your own.

What to do

In the Users card in web/src/pages/Settings.tsx (UsersSection), give each user a way to open their tokens and revoke one. APITokensSection in the same file already lists your own tokens with their name, scope, last use and expiry, so reuse that table rather than building a second one. Ask for confirmation before revoking, the way deleting a user does.

No backend change should be needed. Two notes from AGENTS.md about the UI kit in web/src/ui. cn() does no Tailwind conflict resolution, so size goes through props. Overlays such as a modal render through portals.

Check it at 390 and 1280 pixels wide, then update the token paragraph in docs/api.md and the admin row in docs/users-and-access.md.

Sulaiman-Dauda avatar Oct 22 '26 18:10 Sulaiman-Dauda