20 lines
548 B
JavaScript
20 lines
548 B
JavaScript
/**
|
|
* @typedef {"authenticated" | "unauthenticated" | "recovery-pending" | "integration-failed"} SessionState
|
|
*/
|
|
|
|
/**
|
|
* The session is opaque: credentials are attached without exposing tokens.
|
|
*
|
|
* @typedef {{
|
|
* getState(): SessionState,
|
|
* subscribe(listener: () => void): () => void,
|
|
* beginSignIn(returnTo?: string): Promise<void>,
|
|
* signOut(): Promise<void>,
|
|
* attach(request: Request): Promise<Request>,
|
|
* recover(): Promise<"restored" | "no-session">,
|
|
* onUnauthenticated(): void
|
|
* }} AuthSessionPort
|
|
*/
|
|
|
|
export {};
|