Engineering/AI documentation
Passkeys And Two-Factor Authentication
Settings includes passkey and TOTP management for strengthening account authentication.
Concepts: webauthn, totp
Implementation Summary
Settings includes account profile/password controls, recovery-code regeneration, passkey management, and TOTP management for strengthening account authentication.
Frontend Surface
frontend/src/components/settings/AccountSecurityManager.tsxfrontend/src/components/settings/PasskeyManager.tsxfrontend/src/components/settings/TOTPManager.tsxbackend/app/api/routes/auth.pybackend/app/api/routes/webauthn.pybackend/app/core/recovery_codes.py
State, API, And Backend Contracts
Stores
frontend/src/stores/authStore.ts
API And Backend
backend/app/api/routes/webauthn.pybackend/app/api/routes/auth.py
Architecture Notes
- The feature is mounted through
frontend/src/components/settings/PasskeyManager.tsxand the UI navigation path recorded in the inventory. - Passkey listing and mutation read the in-memory
authStoretoken. Login bootstrap must hydrate that token from the same browser JWT validated byfetchMe()so Settings never reports a false unauthenticated state after a successful sign-in. - The frontmatter and manifest entries are the durable contract for agents updating this page after code changes.
- When the referenced component, store, route, agent, skill, or test behavior changes, regenerate and validate the feature documentation.
Agents, Skills, LLM, MCP, And Permissions
- Authentication-factor behavior is security-sensitive and must be verified with the repository security benchmark when implementation changes.
- Current factors are password plus optional TOTP, one-time recovery-code fallback, and WebAuthn/passkeys for passwordless sign-in. SMS and email OTP factors are not implemented.
- Recovery codes are shown once during first-admin onboarding, connection-string account creation, and admin-created user flows; regeneration invalidates previous codes.
- Profile and password changes require the current password. Password changes revoke other sessions where possible.
- Profile updates omit optional username/email fields when their form values are blank. This is fail-closed for encrypted PII that the API redacts after a decryption failure; an empty email is never submitted as an invalid replacement.
- The profile panel requests one authoritative
/api/auth/merefresh when a non-local team identity mounts without a username or email, so a race during login bootstrap cannot leave editable identity fields blank. A redacted email remains blank after that single refresh and is never exposed as ciphertext.
Tests And Verification
tests/test_auth_security.pyfrontend/src/stores/authStore.test.tsfrontend/src/lib/profileFormState.test.tsfrontend/src/lib/profileUpdatePayload.test.ts
Related Features
Related Concepts
Compass Evidence
- Spec/task: CF-SPEC-134 / CF-1671
- Inventory source:
docs/features/inventory.json
When To Update
- Update this page whenever the listed UI components, stores, routes, model behavior, permissions, or tests change.
- Regenerate the site and machine manifests with
python scripts/feature_docs.py --seed-missing --generate-site --check.