Move deleteUser() to client
#15121
Unanswered
imageck
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
It was a bit disappointing to find out that there was no easy method for user deletion. The admin API has
deleteUser()but it's a bit brittle and not perfect. Currently, I'm supposed to create an API route, then manually authorize the user (getSession()+user.idcomparison, really), then call it inside of atry...catchblock, then return the response back to the client, and thensignOut()the user.It would be very convenient and simple (which is what Supabase aims for most of the times) if it was the client that had this method and the aforementioned steps were abstracted away from the developer and encapsulated in it. If you'd like to make it a bit more robust, the method could require a confirmation token that the developer could collect from a user's interaction with a confirmation dialog of sorts, or attach it explicitly to bypass the process.
All reactions