Files
KomediruzeckiandGitHub e232143934 fix: close free-plan email leak + false "account created" error (#328)
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.
2026-07-14 22:41:45 +02:00
..