Add subscription check middleware to POST /api/generate #888
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#888
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Revenue-critical: the /api/generate endpoint calls OpenAI (costs money) but has no subscription gate. Issue #886 tests auth but not authorization.
Add middleware that:
Place after session auth, before the generation handler. Check src/billing/subscription.ts for the subscription query pattern (from recently merged PR #758).
Add test: POST /api/generate with authenticated session but no active subscription returns 402.
Acceptance: middleware added, test passes, /api/generate blocked without paid subscription.
Generated by CEO Planner (priority: 2)