From b350432c28b9cb71960b4239d76fdeb8c594fc8a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 17:15:46 +0000 Subject: [PATCH] fix: read the correct session cookie for auth-aware nav buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auth-detection script was looking for an `assembly_session` cookie that nothing set. The dashboard actually writes `current-portal-session` on the `.assembly.com` parent domain — now that the marketing site serves from assembly.com the cookie is visible, so reading the right name makes the "Open Assembly" / "Log in + Get started" toggle work. --- src/lib/auth-script.ts | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/lib/auth-script.ts b/src/lib/auth-script.ts index 3d59eab..c016a25 100644 --- a/src/lib/auth-script.ts +++ b/src/lib/auth-script.ts @@ -4,21 +4,14 @@ // error rather than the script. /** - * Whether the visitor is signed in to Assembly. The app - * (dashboard.assembly.com) and this site (assembly.com) are different - * origins, so the app's session can't be read directly. Instead the app sets a - * non-httpOnly cookie on the shared `.assembly.com` parent domain, which any - * page under that domain can read client-side. + * Whether the visitor is signed in to Assembly. The dashboard sets a cookie on + * the shared `.assembly.com` parent domain, which any page under that domain + * can read client-side. * - * KNOWN GAP: nothing sets this cookie yet. The dashboard's only cookie is - * written host-only (no `domain` attribute), so it is invisible here and every - * visitor currently resolves to signed-out. SESSION_COOKIE must be matched to - * whatever the app team ships before any of this does anything in production. - * - * A Vercel preview URL is not under `.assembly.com` either, so the cookie is - * never visible there — use the demo override below to see both states. + * A Vercel preview URL is not under `.assembly.com`, so the cookie is never + * visible there — use the demo override below to see both states. */ -export const SESSION_COOKIE = "assembly_session"; +export const SESSION_COOKIE = "current-portal-session"; /** * Demo override so both states can be shown on a preview URL: add `?authed=1`