having trouble allowing users to delete their account from client
Hey friends,
Trying to allow users to delete their own account in my iOS app. I created a RPC with security definer that runs delete from auth.users where id = auth.uid();
The issue I'm having is the user isn't signed out when that's called. I tried explicitly calling auth.signOut afterwards, however that throws an error since the user no longer exists. If I call auth.signOut before calling the delete, then the delete doesn't work since the user is no longer signed in.
Anyone have any advice on how I can both delete & logout? Is there a method to nullify or expire the JWT or something?
Thanks!
Trying to allow users to delete their own account in my iOS app. I created a RPC with security definer that runs delete from auth.users where id = auth.uid();
The issue I'm having is the user isn't signed out when that's called. I tried explicitly calling auth.signOut afterwards, however that throws an error since the user no longer exists. If I call auth.signOut before calling the delete, then the delete doesn't work since the user is no longer signed in.
Anyone have any advice on how I can both delete & logout? Is there a method to nullify or expire the JWT or something?
Thanks!