Skip to content

feat: allow users to mint authentication tokens from the ui, and communities to revert them#3614

Open
tefkah wants to merge 1 commit into
mainfrom
tfk/auth-token
Open

feat: allow users to mint authentication tokens from the ui, and communities to revert them#3614
tefkah wants to merge 1 commit into
mainfrom
tfk/auth-token

Conversation

@tefkah
Copy link
Copy Markdown
Member

@tefkah tefkah commented May 19, 2026

Issue(s) Resolved

We will be changing log in mechanisms soon, which may break sdk/api usage. we should enable the ability to mint auth tokens from the ui

Tokens are scoped to community + user.
Tokens cna be revoked by the user or any admin of the community.

Test Plan

Screenshots (if applicable)

User view

image

Community view
image

Optional

Notes/Context/Gotchas

Supporting Docs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds UI and API support for minting, listing, and revoking community-scoped authentication tokens from user account settings and community admin settings.

Changes:

  • Adds auth token list/revoke endpoints for users and community admins.
  • Adds user settings UI for generating and revoking personal auth tokens.
  • Adds community settings UI for admins to view and revoke community-scoped tokens.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/api/contracts/authToken.ts Extends the auth token contract with listing and community revoke routes.
server/routes/legal.tsx Passes admin community data into legal/settings view data.
server/community/queries.ts Adds a query for communities where the user is an admin.
server/authToken/api.ts Implements token listing and community-level revocation endpoints.
server/authToken/__tests__/api.test.ts Adds tests for listing and revoking auth tokens.
client/containers/Legal/PrivacySettings.tsx Renders the auth token settings card.
client/containers/Legal/Legal.tsx Adds admin community props for settings.
client/containers/Legal/AuthTokensCard.tsx Adds user-facing auth token creation/list/revoke UI.
client/containers/DashboardSettings/CommunitySettings/CommunityAuthTokens.tsx Adds community admin token list/revoke UI.
client/containers/DashboardSettings/CommunitySettings/CommunityAdminSettings.tsx Adds the community auth token section to admin settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/authToken/api.ts
Comment on lines +74 to +77
await ensureUserIsCommunityAdmin({
user: req.user,
id: params.communityId,
});
Comment thread server/authToken/api.ts
Comment on lines +122 to +125
await ensureUserIsCommunityAdmin({
user: req.user,
id: params.communityId,
});
.delete(`/api/authTokens/community/${anotherCommunity.id}/${anotherAuthToken.id}`)
.set('Host', `${community.subdomain}.pubpub.org`)
.expect(403);
});
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.

2 participants