import { auth } from "@/lib/auth"
const ctx = await auth.$context as Record<string, unknown>
const keys = Object.keys(ctx).filter((k) => /session|cookie/i.test(k))
console.log("clefs pertinentes :", keys)
for (const k of keys) {
  const v = ctx[k]
  if (v && typeof v === "object") {
    const o = v as Record<string, unknown>
    const found = Object.entries(o).filter(([n]) => /expires|updateAge|maxAge/i.test(n))
    if (found.length) console.log(k, ":", Object.fromEntries(found))
    if (k === "authCookies") {
      const s = (o as Record<string, { options?: { maxAge?: number } }>).sessionToken
      if (s?.options?.maxAge) console.log("  cookie de session, maxAge :", s.options.maxAge, "s =", s.options.maxAge / 3600, "h")
    }
  }
}
process.exit(0)
