-
Notifications
You must be signed in to change notification settings - Fork 0
Description
When you delete an account with us, we'll call DeleteTherapist() and remove your data from our therapist table.
However, what we don't do, is delete this entry from our 'users' table which is the pre-built Auth table in Supabase. This means, our auth table still has your data.
Essentially, what happened is, I made an account, deleted it, and tried to make a new account with the same email, and I got the error: user_already_exists.
Additionally, DeleteTherapist() does not work when it has students dependent on it:
http error: 500 Failed to delete user data: ERROR: update or delete on table "therapist" violates foreign key constraint "student_therapist_id_fkey" on table "student" (SQLSTATE 23503)
http error: 500 Failed to delete user data: ERROR: update or delete on table "therapist" violates foreign key constraint "student_therapist_id_fkey" on table "student" (SQLSTATE 23503)" method=DELETE path=/api/v1/auth/delete-account/ed26acfb-61db-4056-ab2d-f04fff912be0
Deliverable:
- Make sure that you're able to delete from therapist table when it has students dependent on it as FK.
- Make sure that when you delete an account, we know it gets deleted from therapist table, but make sure it also gets deleted from Supabase 'auth' table.