Log account delete and subscription changes in UserAuthEvent
Add account_deleted, subscription_started, and subscription_updated event types. Soft-delete, Checkout/Backer assign, and Stripe portal lifecycle webhooks write audit rows visible on the user admin.
This commit is contained in:
@@ -190,7 +190,7 @@ Push/merge to `master` auto-deploys **beta** only. Prod requires the Gitea
|
||||
| Auth | JWT (authenticated user only; always deletes `request.user`) |
|
||||
| Optional body | `{ "refresh_token": "<current refresh>" }` |
|
||||
| Success | `200` `{ "detail": "Account deleted.", "deleted": true }` |
|
||||
| Effects | Sets `deleted=True`, `is_active=False`; soft-deletes conversations; blacklists outstanding refresh tokens |
|
||||
| Effects | Sets `deleted=True`, `is_active=False`; soft-deletes conversations; blacklists outstanding refresh tokens; logs `UserAuthEvent` `account_deleted` |
|
||||
| Staff | Staff/superuser self-delete rejected (`400`, `code=staff_forbidden`) |
|
||||
| Privacy v1 | Soft-delete only (no anonymization / hard purge) |
|
||||
|
||||
@@ -205,6 +205,10 @@ Plan change and cancel stay on Stripe Customer Portal
|
||||
`GET /api/finance/subscription/` includes `cancel_at_period_end` and
|
||||
`current_period_end` for Account UI messaging.
|
||||
|
||||
Subscription audit (`UserAuthEvent` on the user admin):
|
||||
- `subscription_started` — first active plan (Checkout, Backer redeem, admin assign)
|
||||
- `subscription_updated` — plan/status/cancel-at-period-end changes (portal + webhooks)
|
||||
|
||||
## Security note
|
||||
|
||||
Secrets previously hardcoded in `settings.py` (email password, captcha, Django
|
||||
|
||||
Reference in New Issue
Block a user