The privacy policy already told users that "deleting your account from the dashboard removes your content" — there was no way to do it. This adds one: Account -> Delete account in the dashboard, DELETE /api/account on the server. The endpoint refuses API-key auth (a leaked osk_ must not destroy the account it was issued from) and requires the caller to retype the account email; the UI does the same, collapsed behind a danger zone that itemises what actually goes. Erasure is immediate and irreversible, because after it there is nothing left to authenticate a recovery request against. The order of the steps is the design, each one a failure mode: - Stripe cancel first, aborting everything if it fails, so we never erase a user we are still billing. An InvalidRequestError is treated as already cancelled: a portal cancellation whose webhook never landed leaves our row reading "active" forever, and the one account that could not be deleted would be the one Stripe already stopped charging. - R2 before the database, because those rows are the only index of which objects belong to the user; dropping them first turns a failed purge into permanent orphans. - The DB delete is one transaction over an explicit table list, not the declared ON DELETE CASCADEs: create_all never ALTERs an existing table, so a constraint added after a table shipped lives in the models and not in production. tests/test_account_erasure.py fails if a new table references users.id without joining that list. - A reserved usage_ledger row blocks the delete: erasing under a running job would pull the output from beneath it and leave the reservation unsettled. What survives, and why: the Stripe customer and its invoices (six years, Spanish commercial law) and one account_deletions row holding a sha256 of the email as proof the erasure happened, itself purged after five years by the retention sweeper. app.py registers a callback so the working files in output/ and uploads/ go too instead of waiting for the hourly sweep. Privacy policy sections 6 (EN + ES) now point at the button and name both survivors; the Legal hub summary says the same in one line. |
||
|---|---|---|
| .. | ||
| public | ||
| seo | ||
| src | ||
| .gitignore | ||
| Dockerfile | ||
| eslint.config.js | ||
| index.html | ||
| nginx.conf | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| vite-plugin-seo.js | ||
| vite.config.js | ||
React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.