Delete user
important
This is applicable for supertokens core version >= 3.7.
This feature allows you delete a user from the SuperTokens based on their user ID.
- NodeJS
- GoLang
- Python
import {deleteUser} from "supertokens-node";
async function deleteUserForId() {
let userId = "..." // get the user ID
await deleteUser(userId); // this will succeed even if the userId didn't exist.
}
import "github.com/supertokens/supertokens-golang/supertokens"
func main() {
userId := "..." // get the user ID somehow...
supertokens.DeleteUser(userId) // this will succeed even if the userId didn't exist.
}
- Asyncio
- Syncio
from supertokens_python.asyncio import delete_user
async def do_delete():
user_id = "..." # get the user ID somehow...
await delete_user(user_id) # this will succeed even if the userId didn't exist.
from supertokens_python.syncio import delete_user
user_id = "..." # get the user ID somehow...
delete_user(user_id) # this will succeed even if the userId didn't exist.
caution
- Calling this function will permanently remove all information associated with this user, including their sessions.
- If this user has an active access token, and you have not enabled access token blacklisting, session verificaiton will still succeed until their access token expires. After that, they will be logged out since session refresh will fail.