[object Object]

← back to Grant

Remove debug logging from auth-branch page

1967d65af66624afc2f5658aba0aee1d065303bc · 2026-05-30 10:02:27 -0700 · Steve Abrams

Files touched

Diff

commit 1967d65af66624afc2f5658aba0aee1d065303bc
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sat May 30 10:02:27 2026 -0700

    Remove debug logging from auth-branch page
---
 app/page.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/page.tsx b/app/page.tsx
index bf09054..050606e 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -1,15 +1,17 @@
-import { cookies, headers } from 'next/headers';
+import { cookies } from 'next/headers';
 import AppShell from '@/components/AppShell';
 import Landing from '@/components/landing/Landing';
 import { verifyAuth } from '@/lib/auth';
 
+// Auth-branch the root route: signed-in visitors get the app, everyone else
+// the public fit-feed landing. Read the cookie via the canonical cookies()
+// API — headers().get('cookie') came back empty in the prod RSC render — and
+// verify with verifyAuth (the verifier this build exports).
 export default async function Home() {
   const jar = await cookies();
-  const h = await headers();
   const cookieHeader = jar.getAll().map((c) => `${c.name}=${c.value}`).join('; ');
-  const rawHeader = h.get('cookie') || '';
   const shim = { headers: { get: (k: string) => (k.toLowerCase() === 'cookie' ? cookieHeader : null) } };
   const session = verifyAuth(shim as unknown as Request);
-  console.error(`[PAGE-DEBUG] jarCount=${jar.getAll().length} reconLen=${cookieHeader.length} rawLen=${rawHeader.length} hasGrantAuth=${cookieHeader.includes('grant-auth')} session=${JSON.stringify(session)}`);
+
   return session ? <AppShell /> : <Landing />;
 }

← 330e761 Auth-branch /: read cookie via cookies() API (headers().get  ·  back to Grant  ·  Security audit P1/P2 fixes: CSRF guard, sanitize outreach HT ee53e6f →