Skip to content

feat(cas-frontend): passkey list on the dashboard (#716) - #731

Merged
Themezv merged 1 commit into
masterfrom
feat/cas-frontend-passkey-list
Sep 17, 2026
Merged

Themezv merged 1 commit into
masterfrom
feat/cas-frontend-passkey-list

Conversation

@Themezv

@Themezv Themezv commented Sep 16, 2026

Copy link
Copy Markdown
Member

Closes #716. Part of #671, first. After #730.

What

  • entities/passkey: listPasskeys() over GET /api/passkeys and the Passkey type (id, name, createdAt, lastUsedAt or null), 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) replaces requireSession as 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.
  • The "Пасскеи" section on the dashboard: a row per passkey (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 through loadDashboard too.
  • In the browser against a running CAS: / without a session still lands on /sign-in, and /api/passkeys is 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

`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>
@Themezv
Themezv merged commit acd1943 into master Sep 17, 2026
4 checks passed
@Themezv
Themezv deleted the feat/cas-frontend-passkey-list branch September 17, 2026 20:49
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.

cas-frontend: passkey list on the dashboard

1 participant