diff --git a/apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx b/apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx index 04f9646799c..fccbd8aa7f5 100644 --- a/apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx +++ b/apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx @@ -6,7 +6,13 @@ import { headers } from "next/headers"; import { env } from "@/env"; export async function CTAButtons() { - const session = await auth.api.getSession({ headers: await headers() }); + let session = null; + try { + session = await auth.api.getSession({ headers: await headers() }); + } catch (error) { + // Handle errors from invalid/stale cookies (e.g., old Clerk cookies after migration to Better Auth) + console.error("[marketing/CTAButtons] Failed to get session:", error); + } if (session) { return (