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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user