Skip to content

Fix build reliability and harden admin integrations - #9

Merged
Dev-Sahad merged 3 commits into
mainfrom
agent/fix-build-and-admin-security
Jul 20, 2026
Merged

Fix build reliability and harden admin integrations#9
Dev-Sahad merged 3 commits into
mainfrom
agent/fix-build-and-admin-security

Conversation

@Dev-Sahad

Copy link
Copy Markdown
Owner

What changed

  • regenerated the corrupted npm lockfile and aligned ESLint/TypeScript with Next.js 15
  • fixed SSR startup failures caused by browser storage access and incomplete Supabase fallbacks
  • moved middleware into src/ so admin protection is included in the production build
  • restricted database setup/import/seed endpoints to verified administrators and changed mutations to POST
  • removed hard-coded Discord webhook credentials and server secrets from public/query-string handling
  • added safer Supabase RLS setup examples and documented required server environment variables
  • fixed focused lint, accessibility, and React hook issues

Why

The repository could not perform a deterministic clean install, its build tooling failed before checking source, and the production home route returned 500 without configured Supabase variables. The admin middleware was not emitted from the existing location, leaving protected pages and database mutation endpoints reachable without the intended server-side guard. A Discord webhook credential was also committed directly in source.

Impact

Clean installs and production builds now complete. The public home page renders without service credentials, unauthenticated admin requests redirect to login, and privileged mutation APIs return 401 unless a verified administrator is present.

Validation

  • npm ci --dry-run --no-audit --no-fund
  • npm run lint (passes; 17 existing <img> optimization warnings)
  • npx tsc --noEmit
  • npm run build
  • production smoke test: / 200, /admin/dashboard 307 to login, /admin/login 200
  • unauthenticated POST /api/seed-certificates and POST /api/setup-db: 401
  • hard-coded Discord webhook scan: clean

Required follow-up

The previously committed Discord webhook must be revoked and regenerated because removing it from the current source does not remove it from Git history. Apply the hardened RLS policies to the live Supabase database and configure ADMIN_EMAIL plus the server-only variables documented in .env.example.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
portfolio-v1 Ready Ready Preview, Comment Jul 20, 2026 9:30am

@Dev-Sahad
Dev-Sahad marked this pull request as ready for review July 20, 2026 09:30
@Dev-Sahad
Dev-Sahad merged commit 78a8f0a into main Jul 20, 2026
5 of 6 checks passed
@Dev-Sahad
Dev-Sahad deleted the agent/fix-build-and-admin-security branch July 20, 2026 09:32
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