Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a delete user API #79

Closed
inian opened this issue Mar 25, 2021 · 5 comments
Closed

Adding a delete user API #79

inian opened this issue Mar 25, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@inian
Copy link
Member

inian commented Mar 25, 2021

Currently there is no Gotrue method for deleting users.

We do have a delete user on the dashboard, but Copple says it directly removes the user from auth.users. We should support this directly in Gotrue so that others can call this via supabase-js and better for our audit trails, etc.

User request

@inian inian added the bug Something isn't working label Mar 25, 2021
@icecream78
Copy link
Contributor

@inian actually, Gotrue has method for deleting users. Delete request to /admin/user/{user_id} will do what you need

@NathBabs
Copy link

@icecream78 but this method doesn't exist on supabase-js

@awalias
Copy link
Member

awalias commented Mar 27, 2021

I think we have this already:

DELETE /admin/users/{user_id} but the JWT role needs to be service_role or supabase_admin

might just need adding to gotrue-js as @NathBabs says

@nicholaschiang
Copy link

@inian @NathBabs it looks like it does exist (as documented here):

const { user, error } = await supabase.auth.api.deleteUser(
  '715ed5db-f090-4b8c-a067-640ecee36aa0',
  'YOUR_SERVICE_ROLE_KEY'
)

@awalias
Copy link
Member

awalias commented Jun 14, 2021

yes fixed here: supabase/auth-js#85

@awalias awalias closed this as completed Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants