How do I use the auth.api.deleteUser endpoint from a server action?

I am trying to figure out how to invoke different auth.api endpoints from my server code in NextJS. I cannot seem to figure out what the implementation should be.
2 Replies
Tyler
TylerOP2w ago
Oh its meant for a user deleting their own account... How would I call an admin action to delete a user like based on ID? Oh there is an admin plugin available. Interesting. For reference this is how you can use things to delete the "currently logged in user":

await auth.api.deleteUser({
headers: await headers(),
body: {},
});

await auth.api.deleteUser({
headers: await headers(),
body: {},
});

Did you find this page helpful?