import { cookies } from "next/headers"; import { getOAuthClient } from "./client"; export const getDID = async () => { const cookieStore = await cookies(); return cookieStore.get("did")?.value ?? null; }; export const getSession = async () => { const did = await getDID(); if (!did) { return null; } try { const client = await getOAuthClient(); return await client.restore(did); } catch { return null; } };