Skip to content

feat(session): complete auth persistence (cookies + localStorage + IndexedDB)#70

Merged
fusengine merged 1 commit into
mainfrom
feat/persist-auth-indexeddb
Jun 12, 2026
Merged

feat(session): complete auth persistence (cookies + localStorage + IndexedDB)#70
fusengine merged 1 commit into
mainfrom
feat/persist-auth-indexeddb

Conversation

@fusengine

Copy link
Copy Markdown
Owner

Makes named profile / storageStatePath carry a complete auth state so sessions reopen logged in — even on sites that keep their token in IndexedDB.

Changes

  • src/session/persist-auth.tspersistStorageState(context, path): storageState({ indexedDB: true }), ensureDir, best-effort. Single storageState call site now.
  • close.ts + probe-run.ts use it → cookies + localStorage + IndexedDB persisted.
  • act.ts — saved immediately after browser_login succeeds, not only on clean teardown (no auth loss on crash).
  • docs/configuration.md + README features + CHANGELOG, same commit.

Notes

  • Works identically headless and headed on Chromium.
  • userDataDir (full persistent Chromium profile) unchanged — already covers everything natively.
  • Not a new tool — count stays 44.

Test plan

  • bun test tests/unit — 305 pass (incl. persist-auth.test.ts)
  • bun run test:integration — 20 pass (real Chromium, incl. storageState restore regression test)
  • Live: IndexedDB token written, replayed after reopen (tests/live/live-persist-idb.ts)
  • tsc + Biome clean
  • CI green

Breaking changes

None — additive.

…dexedDB)

storageState now saved with indexedDB:true via a shared persistStorageState helper (close + probe-run), and persisted immediately after browser_login (not just on clean teardown). Sessions storing auth in IndexedDB reopen logged in; works headless and headed on Chromium. userDataDir unchanged. Verified live (IndexedDB token replayed after reopen). Docs + README + CHANGELOG in the same commit.
@fusengine fusengine merged commit c284062 into main Jun 12, 2026
1 check passed
@fusengine fusengine deleted the feat/persist-auth-indexeddb branch June 12, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant