You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spawned from #147 (non-blocking review observations).
Summary
The session.endpoint warning added in #147 fires for a configuration that #135 deliberately supports, so a correctly-configured project sees it on every CLI invocation.
if(rawSessionAuth&&!mergedSessionAuth){console.warn('[apijack] sessionAuth is set but missing session.endpoint — SessionAuthStrategy will not be used.',);}
An endpoint-less sessionAuth: { refreshOn: [401] } block is intentional under #135 — refreshOn is sourced from rawSessionAuth precisely so it survives the mergedSessionAuth narrowing, asserted at tests/auth/refresh-wiring.test.ts:57. CLAUDE.md's "settings.jsonauth.refreshOn takes precedence over sessionAuth.refreshOn when both are set" further implies sessionAuth.refreshOn alone is a supported route. Those users are now warned about a config that works as intended.
The warning's actual target is the typo case (sessions: for session:), where the block carries handshake keys but no reachable endpoint.
Suggested approach
Gate the warning on the block carrying keys beyond refreshOn — that keeps the typo diagnostic and stays quiet for the deliberate refresh-only config. Worth confirming against real usage before changing, since the alternative reading is that an endpoint-less block should always be loud and the docs should stop implying otherwise.
The warning names what's missing but not what was found. Echoing the offending block's top-level keys (e.g. found: sessions, cookies) would point a typo'd user straight at the mistake instead of leaving them to diff their config against the docs.
Acceptance criteria
A deliberate endpoint-less sessionAuth: { refreshOn: [...] } block produces no warning
A block with handshake keys but no reachable session.endpoint (the typo case) still warns
The warning names the offending block's top-level keys
Spawned from #147 (non-blocking review observations).
Summary
The
session.endpointwarning added in #147 fires for a configuration that #135 deliberately supports, so a correctly-configured project sees it on every CLI invocation.An endpoint-less
sessionAuth: { refreshOn: [401] }block is intentional under #135 —refreshOnis sourced fromrawSessionAuthprecisely so it survives themergedSessionAuthnarrowing, asserted attests/auth/refresh-wiring.test.ts:57. CLAUDE.md's "settings.jsonauth.refreshOntakes precedence oversessionAuth.refreshOnwhen both are set" further impliessessionAuth.refreshOnalone is a supported route. Those users are now warned about a config that works as intended.The warning's actual target is the typo case (
sessions:forsession:), where the block carries handshake keys but no reachable endpoint.Suggested approach
Gate the warning on the block carrying keys beyond
refreshOn— that keeps the typo diagnostic and stays quiet for the deliberate refresh-only config. Worth confirming against real usage before changing, since the alternative reading is that an endpoint-less block should always be loud and the docs should stop implying otherwise.Also in scope (same file, both cosmetic)
src/auth/refresh-wiring.tsmodule JSDoc still reads "Kept pure so both sites stay in lockstep (sessionAuth.refreshOn is unreachable for projects using a custom AuthStrategy #135)". The function now has an I/O side effect, so "pure" is no longer literally true — the lockstep rationale still holds and should stay.found: sessions, cookies) would point a typo'd user straight at the mistake instead of leaving them to diff their config against the docs.Acceptance criteria
sessionAuth: { refreshOn: [...] }block produces no warningsession.endpoint(the typo case) still warnsrefreshOnbehavior from sessionAuth.refreshOn is unreachable for projects using a custom AuthStrategy #135 is unchanged in both casesrefresh-wiring.tsJSDoc no longer claims purity