feat(admin): passkey login, 7-day sessions, role-based admin management#77
Open
ericrihm wants to merge 3 commits into
Open
feat(admin): passkey login, 7-day sessions, role-based admin management#77ericrihm wants to merge 3 commits into
ericrihm wants to merge 3 commits into
Conversation
…w tests - Rewrite card() from innerHTML to createElement+textContent (XSS fix) - Chain tip cards pass plain text instead of HTML wrappers - Analytics: Promise.all → Promise.allSettled with per-section errors - Heartbeat/chain status indicators add ✓/✗ symbols (a11y) - Suspend confirmation shows full user name + ID - New test suites: streams (6), suspend (6), email-suppression (8)\n
- WebAuthn/passkey authentication for instant admin login (no email wait)
- Manual WebAuthn implementation using Web Crypto API (zero npm deps)
- Session extended from 24h to 7 days
- isAdmin() returns { id, email, role } for identity-aware endpoints
- Roles: owner (full control + admin management) vs admin (operator)
- Admin management: invite by email, remove, list with passkey counts
- Migration 014: admin_passkeys table, admin_users columns
- Dashboard UI: passkey login button, enrollment, admin list (owner only)
- 39 new tests across 5 test files (460 total, all passing)\n
Codex CLI (GPT-5.4) review caught two issues: - Invite form used raw fetch() instead of postJson(), missing the Authorization header in bearer-token auth mode (would 401) - register-verify.js had unused challengeKey and allChallenges variables\n
4e5e8a3 to
0e0d2fb
Compare
0e0d2fb to
c679119
Compare
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
isAdmin()now returns{ id, email, role }instead of boolean. Two roles:owner(full control, admin management) andadmin(operator). Bearer token treated asowner.admin_passkeystable for WebAuthn credentials,invited_by/display_namecolumns onadmin_users, owner role upgrade.New endpoints
/api/admin/auth/passkey/register-options/api/admin/auth/passkey/register-verify/api/admin/auth/passkey/auth-options/api/admin/auth/passkey/auth-verify/api/admin/auth/passkeys/api/admin/auth/admins/api/admin/auth/meTest plan
🤖 Generated with Claude Code