Skip to content

Conversation

@howard36
Copy link
Owner

Summary

  • Adds ApiToken model to Prisma schema for token-based API authentication
  • Creates GET /api/collections/[cid]/problems endpoint that returns problems with expanded authors and solutions
  • Includes token generation script at scripts/generate-api-token.ts

Test plan

  • Run migration: npm run local -- prisma migrate dev
  • Generate a token: npx tsx scripts/generate-api-token.ts
  • Test endpoint: curl -H "Authorization: Bearer <token>" http://localhost:3000/api/collections/<cid>/problems
  • Verify 401 for missing/invalid token
  • Verify 403 for token used on wrong collection

🤖 Generated with Claude Code

Implements a simple API to fetch problems for a collection with token-based
authentication. API tokens are tied to a single collection and include
tracking for who created them.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 18, 2026

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

Project Deployment Review Updated (UTC)
probase-3mxk Ready Ready Preview, Comment Jan 18, 2026 9:37pm

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@howard36 howard36 enabled auto-merge (squash) January 18, 2026 21:37
@howard36 howard36 merged commit b2e2f0e into main Jan 18, 2026
3 checks passed
@howard36 howard36 deleted the add-api-endpoint branch January 18, 2026 21:37
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.

2 participants