mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
From prod testing on a free-plan (server-storage) account:
1. Manual email endpoints bypassed the plan gate. /api/notifications/test-email
and /trigger had requireAuth + a rate limit but no feature check, so a free user
could send themselves test/preview/budget/spending emails despite
emailReminders:false (the scheduled cron path already gates via canReceive()).
Add requireFeature(c, "emailReminders", ...) to both. Worker test: free->402,
paid->200.
2. Inline "Cash" account create showed a red "Failed to create account" toast even
though the account was created: POST /accounts returns { id, message }, but
api.createAccount validated the response against AccountSchema, so Zod threw
*after* the row was inserted. Validate the real { id } shape. Regression test added.
Not included (backend now enforces; frontend UX polish is a follow-up): hiding the
receipt-attach control and the email buttons for free users.