// utils.ts import { createDefine, type PageProps as FreshPageProps } from "fresh"; import type { SessionCookie } from "./routes/auth/callback.ts"; import type { User } from "./services/userService.ts"; export interface AuthState { isAuthenticated: boolean; userId: string | null; userType: string | null; roles: string[]; } export interface State { data: SessionCookie; urlRoute: string; host: string; photoUrl: string; stateId: string; sealKey?: string; // The validated seal key for the current session user?: User | null; auth?: AuthState; authError?: string; } export type PageProps = FreshPageProps; export const define = createDefine();