Summary
The useAuth / WIGOLO_AUTH_STATE_PATH feature plumbs an auth storageState path all the way from config → getAuthOptions() → the fetch router, but MultiBrowserPool.fetchWithBrowser never actually loads that storage state onto the Playwright context. As a result, an authenticated useAuth fetch runs as a logged-out visitor even though a valid storage-state file is configured.
Where the plumbing stops
src/fetch/auth.ts getAuthOptions() returns { storageStatePath } when WIGOLO_AUTH_STATE_PATH is set.
src/fetch/router.ts spreads it into fetchWithBrowser options (e.g. around lines 1084-1110).
src/fetch/browser-pool.ts declares storageStatePath in BrowserFetchOptions (line ~147) and only uses it as a gate to skip the cdp-direct escalation rung (line ~623). It is never passed to newContext({ storageState }), context.addCookies, or context.addInitScript.
The three newContext(...) call sites (pooled, CDP, stealth) all create the context without any storage-state restore. The sibling userDataDir (WIGOLO_CHROME_PROFILE_PATH) is likewise never consumed, but this issue focuses on the storageState half of useAuth.
Expected behavior
When storageStatePath is configured and the file exists, the context for that fetch should be seeded with the stored cookies (and origin localStorage), so useAuth fetches run as the authenticated account.
Environment
Happy to open a PR implementing this if the approach is agreed.
Summary
The
useAuth/WIGOLO_AUTH_STATE_PATHfeature plumbs an auth storageState path all the way from config →getAuthOptions()→ the fetch router, butMultiBrowserPool.fetchWithBrowsernever actually loads that storage state onto the Playwright context. As a result, an authenticateduseAuthfetch runs as a logged-out visitor even though a valid storage-state file is configured.Where the plumbing stops
src/fetch/auth.tsgetAuthOptions()returns{ storageStatePath }whenWIGOLO_AUTH_STATE_PATHis set.src/fetch/router.tsspreads it intofetchWithBrowseroptions (e.g. around lines 1084-1110).src/fetch/browser-pool.tsdeclaresstorageStatePathinBrowserFetchOptions(line ~147) and only uses it as a gate to skip thecdp-directescalation rung (line ~623). It is never passed tonewContext({ storageState }),context.addCookies, orcontext.addInitScript.The three
newContext(...)call sites (pooled, CDP, stealth) all create the context without any storage-state restore. The siblinguserDataDir(WIGOLO_CHROME_PROFILE_PATH) is likewise never consumed, but this issue focuses on the storageState half ofuseAuth.Expected behavior
When
storageStatePathis configured and the file exists, the context for that fetch should be seeded with the stored cookies (and origin localStorage), souseAuthfetches run as the authenticated account.Environment
Happy to open a PR implementing this if the approach is agreed.