fix: some security issues

This commit is contained in:
charles-gauthereau
2026-05-28 10:18:28 +02:00
parent 7a97721abf
commit 40cdb3d0ab
3 changed files with 41 additions and 1 deletions
+8
View File
@@ -78,6 +78,14 @@ export function withApiKey(handler: ApiKeyHandler) {
throw new Error("Unable to find user")
}
if (userFetched.banned) {
return NextResponse.json({ error: "Account suspended" }, { status: 403 });
}
if (userFetched.role === "pending") {
return NextResponse.json({ error: "Account pending approval" }, { status: 403 });
}
const userPermissions = computeSystemPermissions(userFetched)
const user = {
+1
View File
@@ -713,6 +713,7 @@ export const deleteApiKey = async (keyId: string) => {
await auth.api.deleteApiKey({
body: {
keyId: keyId,
configId: "standard",
},
headers: await headers(),
});