Skip to content

Comments

Claude#138

Merged
jaylong255 merged 11 commits intomainfrom
claude
Feb 12, 2026
Merged

Claude#138
jaylong255 merged 11 commits intomainfrom
claude

Conversation

@jaylong255
Copy link
Member

@jaylong255 jaylong255 commented Feb 12, 2026

Note

High Risk
Adds new Supabase-authenticated admin area plus new lead-capture storage/processing endpoints (PII + service-role DB writes), which are security- and data-sensitive. Also introduces hardcoded debug/telemetry fetch calls and a committed debug log that could leak data or cause unexpected network traffic if deployed.

Overview
Adds a Supabase-authenticated /admin console (middleware-protected) with dashboard stats plus CRUD-style views/APIs for leads and transcripts, including login and password reset flows.

Introduces lead capture on the homepage via a new ContactForm + POST /api/leads/submit endpoint that validates input, scores leads (honeypot spam detection), stores leads/events in Supabase, and forwards submissions to an n8n webhook.

Adds an automation endpoint GET /api/automation/transcripts/next-unprocessed secured by CYBERWORLD_AUTOMATION_API_KEY for n8n polling, along with local n8n Docker compose + documentation.

Updates marketing pages: homepage is redesigned into Hero/Services/About/Contact sections with an email-only CTA, blog pages switch from forced dynamic rendering to ISR (revalidate=3600), and the chat API is simplified to direct llm.invoke message calls. Adds client-only Vercel analytics loading and a debug error reporter; the diff also includes multiple hardcoded local ingest fetch logs and a committed .cursor/debug.log.

Written by Cursor Bugbot for commit ae919f2. This will update automatically on new commits. Configure here.

- Add forgot-password and reset-password pages under `app/admin`
- Implement login page enhancements in `app/admin/login/page.tsx`
- Introduce new API route for fetching next unprocessed transcripts in `app/api/automation/transcripts/next-unprocessed/route.ts`
- Clean up `.cursor/debug.log` by removing outdated entries
- Update `.example.env` with necessary environment variables
- Add n8n transcript processing nodes: GetNextUnprocessedTranscript and TranscriptCleanupAgent
- Enhance n8n README.md to include new node details
- Modify `middleware.ts` for authentication handling
- Document n8n transcript processing in `docs/n8n-transcript-processing.md`
- Update `lib/automation-auth.ts` with new authentication functions
- Adjust `docker-compose.n8n.yml`, `supabase/config.toml`, and `supabase/seed.sql` for integration
@vercel
Copy link
Contributor

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
legend Building Building Preview, Comment Feb 12, 2026 4:55pm

Request Review

@jaylong255 jaylong255 merged commit 5cb16ef into main Feb 12, 2026
3 of 4 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 6 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

// #endregion
}, []);
return null;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug telemetry fetch calls shipped in production code

High Severity

Agent debug instrumentation is committed across many production files. DebugErrorReporter is mounted in the root layout (app/layout.tsx line 234), so it fires on every client-side error for every user, sending payloads to http://127.0.0.1:7245. Similar fetch calls to the same localhost endpoint are scattered throughout lib/automation-auth.ts, next-unprocessed/route.ts, app/blog/[slug]/page.tsx, app/blog/page.tsx, and app/admin/reset-password/page.tsx. While the .catch(()=>{}) prevents crashes, these produce failed network requests on every page load and API call in production.

Additional Locations (2)

Fix in Cursor Fix in Web

{"location":"automation-auth.ts:valid","message":"auth passed","data":{},"timestamp":1770336128078,"sessionId":"debug-session","hypothesisId":"H1"}
{"location":"next-unprocessed/route.ts:supabaseCheck","message":"after isServerSupabaseConfigured","data":{"supabaseConfigured":true},"timestamp":1770336128078,"sessionId":"debug-session","hypothesisId":"H2"}
{"location":"next-unprocessed/route.ts:beforeQuery","message":"before supabase query","data":{},"timestamp":1770336128078,"sessionId":"debug-session","hypothesisId":"H3-H4"}
{"location":"next-unprocessed/route.ts:afterQuery","message":"after supabase query","data":{"hasData":true,"errorMessage":null},"timestamp":1770336128097,"sessionId":"debug-session","hypothesisId":"H3"}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug log file committed to repository

Medium Severity

.cursor/debug.log contains local debugging session data (timestamps, hypothesis IDs, auth check results) and is committed to the repository. The .cursor directory is not in .gitignore. This file provides no value in the repo and leaks information about the developer's debugging workflow.

Fix in Cursor Fix in Web

if (urgency) query = query.eq('urgency', urgency);
if (search) {
query = query.or(`name.ilike.%${search}%,email.ilike.%${search}%,company.ilike.%${search}%`);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostgREST filter injection via unsanitized search parameter

Medium Severity

The search query parameter is interpolated directly into the PostgREST .or() filter string without sanitization. Since commas and dots are structural delimiters in PostgREST filter syntax, a crafted search value containing these characters (e.g. x,status.eq.converted) can inject additional filter conditions, potentially bypassing intended query logic. Both the leads and transcripts admin endpoints are affected.

Additional Locations (1)

Fix in Cursor Fix in Web

);
const { data: { user } } = await supabase.auth.getUser();
return user;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical verifyAuth function duplicated across four files

Low Severity

The verifyAuth function is copy-pasted identically across four admin API route files (leads/route.ts, leads/[id]/route.ts, transcripts/route.ts, transcripts/[id]/route.ts). This creates a maintenance burden — any auth logic change (e.g. role checks) needs updating in all four places. A shared utility (similar to the existing createAuthServerClient in lib/supabase-server.ts) would be more maintainable.

Additional Locations (2)

Fix in Cursor Fix in Web

}

setSuccess(true);
onSuccess?.();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success message never visible due to immediate unmount

Medium Severity

In handleSubmit, setSuccess(true) is called immediately followed by onSuccess?.(). The only consumer (ContactCTA) passes () => setShowForm(false) as onSuccess, which unmounts the ContactForm in the same React render batch. The user never sees the "Message Sent!" confirmation — the form simply vanishes and the "Start a Conversation" button reappears, providing no feedback that the submission succeeded.

Additional Locations (1)

Fix in Cursor Fix in Web

}
setPage(1);
setFilters((prev) => ({ ...prev, [key]: value }));
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search debounce defeated by immediate state update

Low Severity

The search debounce in both LeadsTable and TranscriptsTable is ineffective. The code sets up a 400ms setTimeout for the search update, but then immediately updates the same state (setFilters / setSearch) on the next line. Since the useEffect watches that state and triggers fetchLeads/fetchTranscripts, every keystroke fires an API call immediately — plus a redundant second call when the timeout fires. The debounce provides no actual throttling.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant