Skip to content

login: use the key exchange on the API domain - #7

Merged
chrisdengso merged 1 commit into
mainfrom
cli-key-on-api-domain
Oct 23, 2026
Merged

chrisdengso merged 1 commit into
mainfrom
cli-key-on-api-domain

Conversation

@chrisdengso

Copy link
Copy Markdown
Contributor

modapi login now trades the Clerk access token at https://api.moderationapi.com/v1/cli/key instead of dash.moderationapi.com/api/cli/key. The endpoint moves in moderation-api/api#451.

  • New setting KeyExchangeURL (env MODAPI_KEY_EXCHANGE_URL). It is also the default token audience, so the two cannot drift apart. MODAPI_OAUTH_RESOURCE still overrides only the audience.
  • MODAPI_DASHBOARD_URL is now used only for dashboard links in init and login.
  • Error messages say "Moderation API" instead of "dashboard".

go vet and go test -race ./internal/custom/... pass. A new test checks the default URL and that the audience follows the exchange URL.

Merge after moderation-api/api#451 is deployed. Until then, login gets a 404, which the CLI reports as "cannot sign in from the CLI yet".

🤖 Generated with Claude Code

The key exchange moved from the dashboard to the API domain
(moderation-api/api#451). The exchange URL is also the token audience;
MODAPI_KEY_EXCHANGE_URL overrides both, MODAPI_OAUTH_RESOURCE still
overrides only the audience. Dashboard links in init and login are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chrisdengso
chrisdengso merged commit 600f71c into main Oct 23, 2026
1 check passed
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.

1 participant