crysis992
crysis992
BABetter Auth
Created by crysis992 on 5/9/2025 in #help
admin plugin ban user - unauthorized
How do I ban a user in a server side route? Thought thats the way how you perform actions on the server side
await auth.api.banUser({
body: {
userId: input.id,
banReason: 'Your account has been deleted and is no longer available.',
},
});
await auth.api.banUser({
body: {
userId: input.id,
banReason: 'Your account has been deleted and is no longer available.',
},
});
But this just throws an error when it's being executed:
[Error [APIError]: ] {
status: 'UNAUTHORIZED',
body: undefined,
headers: {},
statusCode: 401
}
[Error [APIError]: ] {
status: 'UNAUTHORIZED',
body: undefined,
headers: {},
statusCode: 401
}
4 replies