Add WebAuthn-based glyph recovery flow to Sigil Explorer#388
Add WebAuthn-based glyph recovery flow to Sigil Explorer#388
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef84aa43b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const stored = listStoredKasPasskeys(); | ||
| if (stored.length === 0) { | ||
| throw new Error("No saved passkey was found on this browser for recovery."); | ||
| } |
There was a problem hiding this comment.
Allow passkey recovery without local key cache
This flow hard-fails when listStoredKasPasskeys() returns no local entries, but that function only reads browser localStorage; on a replacement device/browser (the main recovery scenario), a user can still have the synced WebAuthn credential while having zero local cache records, so recovery aborts before even requesting an assertion. As written, this makes the new “Recover My Glyphs” path unusable for lost-device recovery unless the original local storage is still present.
Useful? React with 👍 / 👎.
Motivation
Description
Recover My Glyphsbutton in the Sigil Explorer toolbar and a small status pill to surface progress/results, with a disabled state while recovery is in progress.handleRecoverByPasskeywhich requests an assertion viagetWebAuthnAssertionJson, verifies it withverifyWebAuthnAssertion, derives the authenticated Φ‑Key viaderivePhiKeyFromPubKeyJwk, and then fetches the remote registry withapiFetchJsonWithFailover((base) =>${base}/sigils/state)to find matching glyph URLs.addUrl/persistRegistryToStorage/bumpflow so recovered glyphs are available offline in the current client registry.ApiStateResponse/ApiStateRowtypings only; no server or crypto protocol changes and all logic reuses existing utilities (webauthnReceive,webauthnKAS, registry ingestion).Testing
pnpm -s buildand the build completed successfully.pnpm -s exec eslint src/components/SigilExplorer.tsxwhich passed (file still has pre-existing non-blocking warnings unrelated to the new flow).Codex Task