Wire requireSubscription middleware to POST /api/generate route #1263

Open
opened 2026-04-13 09:55:54 -04:00 by pook · 0 comments
Owner

In the Express app setup where /api/generate route is defined, import and apply the requireSubscription middleware from src/middleware/requireSubscription.ts (being created in #1259). Add it before the generate handler so every document generation request requires an active subscription. Return 402 if subscription is inactive. This is the actual revenue enforcement — without it, the middleware from #1259 exists but isn't applied anywhere. Acceptance: unsubscribed users get 402 on POST /api/generate, subscribed users proceed normally.


Generated by CEO Planner (priority: 2)

In the Express app setup where /api/generate route is defined, import and apply the requireSubscription middleware from src/middleware/requireSubscription.ts (being created in #1259). Add it before the generate handler so every document generation request requires an active subscription. Return 402 if subscription is inactive. This is the actual revenue enforcement — without it, the middleware from #1259 exists but isn't applied anywhere. Acceptance: unsubscribed users get 402 on POST /api/generate, subscribed users proceed normally. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1263
No description provided.