Shares the session with every component. AuthProvider fills this context
and useAuth reads it; nothing else should touch it.
I
AuthContextValue
Provided by AuthProvider to useAuth, which builds the session's API on
it.
- authResponse: Session | null
-
setAuthResponse: Dispatch<SetStateAction<Session | null>>
Replaces the session in memory only. Its callers store the new session themselves, with
storeSession, so other tabs follow.
v
AuthContext: React.Context<AuthContextValue>
The session's context. Its default, a signed-out session whose setter does
nothing, is only seen outside AuthProvider, as in some tests.
Usage
import * as mod from "src/contexts/auth/AuthContext.ts";