Add API token management to the admin dashboard - #202
Merged
Conversation
Super admins can now list, create, edit, and revoke API tokens from /admin/api-tokens, using the createApiToken/updateApiToken/revokeApiToken mutations and apiTokens/apiToken queries that already existed on the backend. A newly created token's secret is shown once, with a copy-to-clipboard control, since the server never returns it again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ej1v1vpzXp7wMaKpBJELc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createApiToken/updateApiToken/revokeApiTokenmutations,apiTokens/apiTokenqueries,ApiTokenGraphQL type) — this PR is frontend-only, wiring the existing API up to a UI that follows the same patterns as the existing Users/Categories admin pages.CopyableSecret) — the server never returns it again, so the create flow makes that explicit and links back to the list once copied.Locations,Users,Categories).Test plan
cd web && npm run relay— regenerated Relay artifacts for the new queries/mutations/fragmentcd web && npx tsc -b— type-checks cleancd web && npx eslint <changed files>— no lint errorscd web && npx prettier --check <changed files>— formattedcd web && npm run test:unit— all 146 existing tests passcd web && npm run build— production build succeedsmake local-e2e(DynamoDB Local) with Playwright, logged in as the seeded super user: created a token and confirmed the secret is shown once with a working copy button, confirmed it appears correctly in the list (name/location/read-only/created), edited it, revoked it, and confirmed it disappears from the (active-only) list afterward.🤖 Generated with Claude Code
https://claude.ai/code/session_017Ej1v1vpzXp7wMaKpBJELc
Generated by Claude Code