## Problem Self-deleting an account via **Settings → Delete account** only called `markAsDeleted()`. It never checked or cancelled the Stripe subscription, so a user could delete their account while still subscribed and **keep getting billed** afterwards. The `user:delete` CLI command already cancelled the subscription, but the web path never got that logic. ## Fix Block account deletion while the user is **on a trial** or holds a **valid, uncancelled subscription**, and direct them to cancel via the billing portal first. - `User::hasActiveSubscriptionOrTrial()` — true on a trial or a `valid()` subscription; **grace-period** (already-cancelled) subscriptions are excluded since they won't re-bill, so deletion is still allowed. - `ProfileController::destroy()` — rejects with a `subscription` error before deleting (server-side guard, also covers non-UI calls). - Delete-account page now receives `hasActiveSubscriptionOrTrial`; when set, the UI shows a warning + **Manage billing** link and hides the delete dialog. - Spanish translations added for the two new strings. The `user:delete` CLI is unchanged — it keeps its auto-cancel-with-confirmation flow for admin use. ## Tests - Active subscription → deletion blocked - Trialing subscription → deletion blocked - Grace-period (cancelled) subscription → deletion allowed - Delete-account page exposes the flag (true/false) All passing locally, alongside Pint / Prettier / ESLint. |
||
|---|---|---|
| .. | ||
| en | ||
| es | ||
| en.json | ||
| es.json | ||