OPER-25
Fix broken api-keys token-mint UI (POST returns "Could not create token")
Body
## Symptom User visits /operant/settings/api-keys and clicks Create Token. UI shows: "Could not create token. Please try again." Sweet Blanchard successfully minted a token on 2026-07-15 (id=cmrm5o5eh04exjr049ow2522h), so the endpoint worked at some point. Broke sometime between 2026-07-15 and 2026-07-18. ## Not the cause (ruled out) - Migration applied - Table schema matches Prisma model - Team slug "operant" valid - User has TeamMembership on cmrawxvxa0001obz9h9wjtha8 - Auth session works for GET on same route ## Likely suspects - emitEvent / awardPoints / createAuditLog throwing inside the transaction - CreateApiTokenBody.parse schema mismatch with form payload - CSRF or NextAuth middleware regression between 2026-07-15 and now ## Bypass in place Main agent minted justin a bearer token directly via DB INSERT on 2026-07-18 (UserApiToken.id=cmoperbearerec25bf8d6a91) for LEDGER_BEARER_OPERANT. Do NOT revoke without minting a replacement first.
Attachments
Loading attachments…
Comments
Loading comments…