fix(04-07): remove debug code — public page restored

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.
This commit is contained in:
2026-05-23 09:03:06 +02:00
parent 25ae19c9d2
commit 5efb433c23
2 changed files with 1 additions and 7 deletions
-2
View File
@@ -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();
+1 -5
View File
@@ -133,9 +133,6 @@ export interface ClientProjectSummary {
export async function getClientWithProjectsByToken(
tokenOrSlug: string
): Promise<ClientProjectSummary | null> {
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;
}
}