feat(auth): persistent login via rotating refresh tokens (self-hosted + hosted gateway)
Replaces expiry-only JWT sessions with durable, secure persistent login so users stay signed in across access-token expiry without re-authenticating.
- refresh-token-core.mjs: storage-agnostic rotation with reuse detection + family revocation; opaque high-entropy tokens, hashed at rest (raw secret never stored). - Self-hosted Hub: file-backed store (refresh-tokens.mjs) + HttpOnly cookie issuance on OAuth callback; POST /api/v1/auth/refresh and /logout (real server-side revoke). - Hosted gateway: Netlify Blob store (strong consistency for read-after-write reuse detection) via refresh-token-store.mjs; adaptive cookie policy (SameSite=Lax same-origin, None+Secure cross-site) for the api.knowtation.store first-party setup. - Web UI: single-flight silent refresh on 401 before forcing re-login; logout revokes server-side. config.js points production UI at first-party https://api.knowtation.store.
Security: HttpOnly/Secure cookies, token rotation + reuse detection, hashed storage, 0600 store file perms, no raw secrets in responses. Covered by 7-tier tests (unit/integration/e2e/stress/data-integrity/performance/security): 86 new tests, all green.
0 comments
muse hub commit comment sha256:7040861db73b922541fb7a4d44e4d5ca5b07005a6f294a52e586ec73ca739f49 --body "your comment"
No comments yet. Be the first to start the discussion.