declare const LOGOUT_COOKIE = "politogy_logout_at"; /** * Server-side authority. Given the logout-cookie value and the moment this * session was authenticated, is the session revoked? * * `authTime` is the OIDC `auth_time` (seconds) or an equivalent millisecond * timestamp captured when the session was minted. Sessions with no recorded * auth time are treated as revoked whenever a logout is on record: we cannot * prove they postdate it, and failing closed is the only safe direction for a * sign-out. */ declare function isSessionRevoked(logoutCookieValue: string | null | undefined, authTime: number | null | undefined): boolean; /** Read the shared logout timestamp (browser only; null on server or unset). */ declare function readLogoutCookie(): number | null; /** * Record a sign-out for every tab on every Politogy subdomain. Call this * BEFORE navigating to the app's sign-out route, so tabs that are already open * see it immediately rather than after the round trip. * * Scoping mirrors the active-org and theme cookies: parent-domain on * *.politogyvrm.com so all app subdomains read it, host-only anywhere else * (localhost, *.pages.dev previews). */ declare function broadcastLogout(at?: number): void; /** * Clear the signal. Call after a successful LOGIN: the new session postdates * the old sign-out, and leaving the cookie behind would make every future * `isSessionRevoked` check depend on clock skew between the two. */ declare function clearLogoutSignal(): void; type WatchLogoutOptions = { /** * Sessions minted at or before this moment are revoked by a sign-out. Pass * the session's auth time; when omitted, ANY logout signal observed after the * watcher starts fires the callback (correct for an already-open tab, which * by definition authenticated earlier). */ authTime?: number | null; /** Poll interval override, for tests. */ intervalMs?: number; }; /** * Watch for a sign-out that happened in ANY other tab or window, on this or any * sibling Politogy subdomain, and invoke `onLogout` once. * * Returns an unsubscribe function. * * Three signals, cheapest first: * - BroadcastChannel — instant, same-origin only. * - visibility/focus/pageshow — the moment a backgrounded tab is looked at. * - a ~1s cookie poll — the cross-subdomain path, and the backstop for a * visible tab the user is staring at but not interacting with. */ declare function watchLogout(onLogout: () => void, options?: WatchLogoutOptions): () => void; export { LOGOUT_COOKIE, type WatchLogoutOptions, broadcastLogout, clearLogoutSignal, isSessionRevoked, readLogoutCookie, watchLogout };