Watch: Let users delete their account and all their data | Vovy
Watch Vovy do it on a Mac: "Add a delete my account button that wipes all their data". Vovy builds a secure delete account flow that removes the user, their rows, files and billing link, which app stores and privacy laws expect.
"Add a delete my account button that wipes all their data"
Vovy builds a secure delete account flow that removes the user, their rows, files and billing link, which app stores and privacy laws expect.
What happens in the video
- Map everything tied to a user: Vovy reads your Supabase tables and storage buckets and shows a table of every place a user's data lives.
- Set tables to clean up automatically: It adds ON DELETE CASCADE, a rule that deletes a user's rows when the user is removed, to foreign keys that point at auth.users.
- Write a server function: Deleting users needs your secret key, so Vovy writes an Edge Function that checks who's asking, removes their files, and calls auth.admin.deleteUser.
- Cancel billing too: If the user pays, the function cancels their Stripe subscription so they're never charged after leaving.
- Add the button and test it: It adds a Delete account button with a type-to-confirm dialog, deletes a test user, and shows a card proving each table is empty.
Read the step-by-step guideLoading...