feat(cas-frontend): passkey list on the dashboard (#716) - #731
Merged
Merged
Conversation
`entities/passkey` joins with `listPasskeys` over `GET /api/passkeys` and the `Passkey` type (id, name, createdAt, lastUsedAt or null). The dashboard gets its own loader, `loadDashboard`: the gate first, then the list, in that order so that without a session only the gate's 401 turns into the redirect. The page renders the "Пасскеи" section with a row per passkey: the key chip, the name, and "Создан … · Использован …" with the dates said the dashboard's way (сегодня, вчера, 12 сентября, 31 декабря 2025 г.); a passkey that never signed in says "Не использовался". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Closes #716. Part of #671, first. After #730.
What
entities/passkey:listPasskeys()overGET /api/passkeysand thePasskeytype (id,name,createdAt,lastUsedAtornull), read-only for now; rename and delete come with cas-frontend: rename a passkey #717 and cas-frontend: delete a passkey with the last-passkey guard #718.loadDashboard(pages/dashboard/loadDashboard.ts) replacesrequireSessionas the dashboard's loader: the gate first, then the list. Sequential on purpose: without a session both calls are a 401, and only the gate's turns into the redirect to sign-in.PasskeyRow) with the key chip, the name, and "Создан … · Использован …"; a passkey that never signed in says "Не использовался".describeDate: the dates the dashboard's way, in Russian: "сегодня", "вчера" (calendar days in the local zone, not 24-hour windows), "12 сентября" within the year, "31 декабря 2025 г." beyond it. Lower case because it always follows a word.Tests
describeDate.spec.ts: today at any hour, yesterday across midnight, within the year, another year.DashboardPage.spec.tsx: the list renders both rows with their copy through the real loader; the sign-out specs now run throughloadDashboardtoo./without a session still lands on/sign-in, and/api/passkeysis not asked before the gate. A fresh account's dashboard (one passkey named as the backend stores it, "Создан сегодня · Не использовался") needs a signed-in browser: please open http://localhost:5173 with your passkey, the dev server on 5173 serves this branch.pnpm lint:check,pnpm fmt:check,pnpm ts-check,pnpm test:ci(67 tests) pass.🤖 Generated with Claude Code