import { useQuery, type UseQueryOptions } from "@tanstack/react-query"; import { http } from "../api/http"; type SessionResponse = { ok: true; userId: string; email: string | null; displayName: string | null; emailVerified: boolean; updateNotice: { version: number; title: string; body: string; } | null; }; type Options = Omit, "queryKey" | "queryFn">; export function useAuthSession(options?: Options) { return useQuery({ queryKey: ["auth", "session"], queryFn: async () => http("/auth/session", { skipAuthRedirect: true }), retry: false, ...options, }); }