Hey everyone,
I would like users on my app to be able to delete their account, but instead of permanently deleting them, I’d like to perform a soft delete, meaning I’ll anonymize their data.
I have two tables to anonymize:
- The
usertable in my public schema - The
usertable in my auth schema
So far, I’ve managed to set up a workflow in WeWeb where, when a user clicks “Delete my account,” the app soft deletes their record in the public.user table (via a function).
However, I’m struggling to handle the soft delete for the auth.user table. I’ve read a few different approaches but I’m not sure which one makes the most sense:
-
Using
deleteUser()withshouldSoftDelete: true, though I’m not sure how to implement this -
Creating an Edge Function triggered by the user in WeWeb, though this is tricky since users don’t have delete rights
-
Creating an Edge Function triggered automatically when the public user table is updated (e.g., when the
deleted_atcolumn is set)
I’m a bit lost on what makes the most sense. I’m not super familiar with Edge Functions, and what I’ve read so far seems quite technical.
Has anyone done something similar or can recommend the best approach?
Thanks a lot!
Mélanie