BA
Better Auth•4mo ago
Baldy

await authClient.admin.removeUser

I just try to remove an User, and it return success: true but i literally didn't put any id and i leave the code like this
const deletedUser = await authClient.admin.removeUser({
userId: "user_id_here",
});
const deletedUser = await authClient.admin.removeUser({
userId: "user_id_here",
});
If isn't an issue, how to know if it delete nothing cuz didn't exist ?
No description
No description
3 Replies
nikatune
nikatune•4mo ago
its probably an issue.
Ping
Ping•4mo ago
Hey, good callout. I've made a PR, you can track it here: https://github.com/better-auth/better-auth/pull/3271
GitHub
fix(admin): throw an error if user id in /remove-user is invalid ...
Right now if the user id is faked it still returns success: true. This shouldn't be the case, we should return an error if the user id is invalid.
Baldy
BaldyOP•4mo ago
Thx 🙂

Did you find this page helpful?