deckhearth/pages/api
Randall Stillwell b6891f1fa6 fix(api): delete dev endpoints + CI guard (Brief 3 of fix-auth-bypass)
Removes four unauthenticated dev endpoints that were shipped to production:

- pages/api/simple.js          (info leak)
- pages/api/test-auth.js       (auth diagnostic / token-mint side door)
- pages/api/test-db.js         (DB connection diagnostic)
- pages/api/setup-database.js  (public POST that ran DDL + seeded admin)

setup-database is the highest-impact removal: it was a public endpoint
that triggered schema bootstrap and seeded the default admin credentials
(admin@tcgvault.com / admin123). AGENTS.md gotcha #5.

Also adds a new `forbidden-endpoints` job to .github/workflows/ci.yml
that fails the build if any of the four deleted paths re-appear OR if
any new pages/api/test-*.js file is added. Cheap insurance against a
future agent re-introducing a dev endpoint from an outdated tutorial.

README: drops the single `GET /api/test-db` line under "Health Check".
Rest of the API list is intentionally left for the doc-writer pass.

Verified locally:
- npm run build exits 0 (no source callers — confirmed via grep across
  pages/, components/, lib/)
- CI guard local simulation: clean → OK; with test-fake.js → FAIL; OK
  after cleanup

Resolves AGENTS.md gotcha #5. Brief 1/2/4/5 still pending in convoy.

Convoy: fix-auth-bypass / Brief 3
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 09:54:09 -05:00
..
admin Major Scanner Improvements 2025-07-29 14:19:48 -05:00
auth 🎨 Enhanced Signup with Username & Profile Images 2025-07-28 11:18:58 -05:00
cards Major Scanner Improvements 2025-07-29 14:19:48 -05:00
collections Major Scanner Improvements 2025-07-29 14:19:48 -05:00
community 🌍 Separate My Collections & Community Collections 2025-07-27 13:17:13 -05:00
config Major Scanner Improvements 2025-07-29 14:19:48 -05:00
decks Major Scanner Improvements 2025-07-29 14:19:48 -05:00
invite 🎉 COMPLETED: Full Collaborative Collections System 2025-07-25 08:34:28 -05:00
public Major Scanner Improvements 2025-07-29 14:19:48 -05:00
user 🖼️ Complete Avatar Upload System with Vercel Blob 2025-07-26 21:39:42 -05:00
users 🚀 Implemented Complete Collection Functionality 2025-07-25 22:28:52 -05:00
auth-utils.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
collections.js 🔧 Fix SQL Template Literal Syntax Error 2025-07-27 20:00:20 -05:00
decks.js Major Scanner Improvements 2025-07-29 14:19:48 -05:00
favorites.js 🔧 Fixed SQL Syntax Errors in Favorites API 2025-07-25 23:06:16 -05:00
health.js Clean slate: Remove React traces and create pure Next.js setup 2025-07-23 09:32:31 -05:00
user-cards.js Major Scanner Improvements 2025-07-29 14:19:48 -05:00