useAuth

Session state on top of src/lib/authToken.ts. The access token lives in memory only, so script on the page cannot read it from storage; the refresh token is an httpOnly cookie the server reads. Nothing touches localStorage.

Install: pnpm add-composable useAuth

Lifecycle showcase

Sign in and out to see the reactive state. A reload starts signed out: call refresh() on boot to restore the session from the cookie.

API