mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: some security issues
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -713,6 +713,7 @@ export const deleteApiKey = async (keyId: string) => {
|
||||
await auth.api.deleteApiKey({
|
||||
body: {
|
||||
keyId: keyId,
|
||||
configId: "standard",
|
||||
},
|
||||
headers: await headers(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user