From 5efb433c237523c1f2bd316649d47ea89e40feec Mon Sep 17 00:00:00 2001 From: Simone Cavalli Date: Sat, 23 May 2026 09:03:06 +0200 Subject: [PATCH] =?UTF-8?q?fix(04-07):=20remove=20debug=20code=20=E2=80=94?= =?UTF-8?q?=20public=20page=20restored?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: INTERNAL_SECRET was on same line as HOST= in .env (no trailing newline when appended), so proxy middleware got empty secret and rejected all /api/internal/validate-* calls → rewrote every /client/* request to /not-found without running the page component. --- src/app/client/[token]/page.tsx | 2 -- src/lib/client-view.ts | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/app/client/[token]/page.tsx b/src/app/client/[token]/page.tsx index 3047df0..6bd483c 100644 --- a/src/app/client/[token]/page.tsx +++ b/src/app/client/[token]/page.tsx @@ -90,8 +90,6 @@ export default async function ClientPage({ params: Promise<{ token: string }>; }) { const { token } = await params; - const { appendFileSync } = await import("fs"); - appendFileSync("/tmp/clienthub-debug.log", `[${new Date().toISOString()}] PAGE token=${token}\n`); const clientData = await getCachedClientData(token); if (!clientData) notFound(); diff --git a/src/lib/client-view.ts b/src/lib/client-view.ts index 3b48265..66fc3f7 100644 --- a/src/lib/client-view.ts +++ b/src/lib/client-view.ts @@ -133,9 +133,6 @@ export interface ClientProjectSummary { export async function getClientWithProjectsByToken( tokenOrSlug: string ): Promise { - const fs = await import("fs"); - const logLine = `[${new Date().toISOString()}] lookup: ${tokenOrSlug}\n`; - fs.appendFileSync("/tmp/clienthub-debug.log", logLine); try { // Try slug first let clientRows = await db @@ -178,8 +175,7 @@ export async function getClientWithProjectsByToken( return { client, projects: activeProjects }; } catch (err) { - const fs = await import("fs"); - fs.appendFileSync("/tmp/clienthub-debug.log", `[${new Date().toISOString()}] ERROR: ${String(err)}\nStack: ${(err as Error)?.stack ?? "no stack"}\n`); + console.error("[client-view] getClientWithProjectsByToken error:", err); return null; } }