Repository navigation
CLI authorize page and Settings CLI keys card - #317
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
d972401
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d8bb55d8.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-316-cli-author.nemar-website.pages.dev |
This was referenced Sep 7, 2026
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
Website half of ORCID-first CLI sign-in (nemarOrg/nemar-cli#1272, phase 2; tracked by nemarOrg/nemar-cli#1282). The backend device authorization grant shipped in nemarOrg/nemar-cli#1287 on that epic's branch (its ADR 0047).
/cli/authorize?code=XXXX-XXXX: a server-rendered page with no client script. Not signed in, it sends the person through sign-in withnextpreserving the code. Signed in, it looks the code up and asks "Did you just runnemar auth loginon ?", naming the account (username, masked email) and the machine, with Authorize and Deny as real form buttons. Success outcomes finish with a 303 post-redirect-get so a refresh never re-posts; refusals render the backend's own sentence./cliis now an app-host route, so the page always runs where the session cookie lives.nextnow survives a brand-new ORCID sign-up through email verification (complete.astro,dashboard,VerifyEmailStep); the matching backend line lands in the epic's phase 3.astro devhas no backend, so the page and the two key routes carry DEV branches over an in-memory store; the build is checked to contain none of it.Refs #316 (close by hand after merge; closing keywords do not fire on staging).
Test plan
src/lib/host.test.ts:/cli/authorizeis an app route; cross-host redirect keeps?code=; canonical originsrc/lib/device-auth-api.test.ts: exact URLs, methods, headers and bodies for lookup, confirm, deny, list; network failure sentinelsrc/lib/device-authorize.test.ts: every status and body combination of the view model, next-step links, the PRG redirect, the query-driven done viewsrc/lib/device-authorize-dev.test.ts: dev store fixtures and captest/routes/api-auth-keys.test.ts: DEV branches and the forwarding branch through the route harnesstest/cli-authorize-ui.test.ts,test/settings-cli-keys.test.ts,test/orcid-complete-next.test.ts: page-source assertions (Origin check, content-type check, 303, one POST form with both intent buttons, no script, noset:html, noapi_key; card placement, pinned Origin, confirm dialog;nextplumbing)bun run lint,bun run typecheck,bun run test(91 files, 2147 tests),bun run build; no dev-store string indist/_worker.js/cliprefix, the Origin comparison, the 303, the pinned Origin, thenextnavigation each mutated and caughtdev), recorded on Phase 2: Website authorize page and CLI keys card nemar-cli#1282