is there a post delete callback for the backend? want to use it to synchronize with my api database
r
rp_st
05/03/2023, 4:56 PM
hey @zebleck there isn't one. But the delete function is also never automatically called anyway.. and since you have to call it, you can run your post delete logic right after.
z
zebleck
05/03/2023, 5:52 PM
hm, im calling the deletion in the frontend but need a callback in the backend so i can synchronize with my graphql API which has its own User table 🤔
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.
}
r
rp_st
05/04/2023, 11:37 AM
right. So this will be on the backend - so after
await deleteUser(userId);
, you can run your post delete operaitons..
z
zebleck
05/04/2023, 12:40 PM
ah thought it will be called on the frontend, but yeah backend makes more sense i guess, thanks!
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).