/** * @typedef {Object} FlowSession * @property {string} provider the provider id the flow was started for * @property {string} state CSRF nonce echoed on the callback * @property {string} [codeVerifier] PKCE verifier (absent only when the provider rejects PKCE) * @property {string} [nonce] OIDC replay nonce (OIDC providers only) * @property {string} [sessionBinding] opaque binding to the initiating user's session * @property {string[]} [requestedScope] the scopes this flow requested — basis for the SCOPE_NARROWED warning * @property {number} createdAt epoch ms — lets a store enforce a max age */ /** * @param {FlowSession} session * @returns {string} */ export function serializeSession(session: FlowSession): string; /** * @param {string} serialized * @returns {FlowSession} */ export function deserializeSession(serialized: string): FlowSession; export type FlowSession = { /** * the provider id the flow was started for */ provider: string; /** * CSRF nonce echoed on the callback */ state: string; /** * PKCE verifier (absent only when the provider rejects PKCE) */ codeVerifier?: string | undefined; /** * OIDC replay nonce (OIDC providers only) */ nonce?: string | undefined; /** * opaque binding to the initiating user's session */ sessionBinding?: string | undefined; /** * the scopes this flow requested — basis for the SCOPE_NARROWED warning */ requestedScope?: string[] | undefined; /** * epoch ms — lets a store enforce a max age */ createdAt: number; };