Marketplace SPA — Phase 2b: Auth UX improvements (session persistence, stateless challenges, body hash fix) #20
Labels
No labels
meeting-notes
meeting-sensitive
meeting-transcript
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coopcloud_code/home#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Phase 2a (#19) delivered ed25519 keypair vault + signature-based auth. This issue covers the UX and security improvements needed to make it production-quality.
Changes
Frontend (
projectmycelium_marketplace_frontend)sessionStorage. Auto-unlock on page refresh without re-entering passphrase. Auto-lock after 30 min idle.Backend (
projectmycelium_marketplace_backend)BTreeMapwith HMAC-signed challenges. Server signs challenge+pubkey+timestamp, client returns it, server re-verifies. No shared state needed. Horizontally scalable.Deploy (
projectmycelium_marketplace_deploy)Design Reference
Full design:
projectmycelium_marketplace_deploy/docs/DESIGN.mdTesting
cargo checkon both frontend and backendSigned-off-by: mik-tf
Phase 2b Complete — Auth UX Improvements
Commits pushed to
developmentmarketplace_frontend0c0fe90marketplace_backend60b2895marketplace_deployffe3cceWhat was implemented
sessionStorage. Page refresh auto-unlocks without re-entering passphrase. 30 min idle timeout. Touch on every API call.challenge + public_key + timestampwith HMAC-SHA256. Client returns it. Server re-verifies. No BTreeMap, no Redis, horizontally scalable.Test results (local, fixture mode)
cargo check(frontend)cargo check(backend)POST /api/auth/register(pubkey)GET /api/auth/challengePOST /api/auth/login(JWT)GET /api/auth/status(JWT)GET /api/auth/status(no auth)Known limitation
Fixture backend doesn't persist registered users (ephemeral
make_user), so the full challenge-response flow can't complete in fixture mode. Hero mode with OSIS will persist the public key and enablefind_by_public_key. This needs to be addressed with a stateful fixture store or tested in hero mode.Next steps
find_by_public_keywork (add in-memory user store)Signed-off-by: mik-tf
Fixes pushed — all blocking issues resolved
Commits
marketplace_frontend1027cdbmarketplace_backendb2e6c11What was fixed
Fixture user persistence —
FixtureUserAuthnow usesArc<RwLock<Vec<User>>>to store registered users.find_by_public_key()andfind_by_email()search the store. The full register → challenge → verify flow now works in fixture mode.Logout redirect — Navbar "Sign Out" now calls
window.location.set_href("/login")after clearing state. User sees login page instead of broken dashboard.Base-path signing — Middleware strips
APP_BASE_PATHfrom the request path before signature verification. This prevents path mismatch when nginx rewrites/api/xto/marketplace/demo/api/x.Test results (local, fixture mode)
cargo check(frontend)cargo check(backend)Remaining (not blocking)
Signed-off-by: mik-tf
Phase 2b — 100% Complete. All tests pass.
Final commits
marketplace_frontend45ee8ceBrowser E2E test results (MCP hero_browser, live dev)
Smoke tests (live dev)
Screenshots
All captured during browser E2E testing:
What is now production-ready (Phase 2)
Next: Phase 3 — Payment Integration
Signed-off-by: mik-tf