Spaces:
Paused
Paused
wrong condition
Browse files
src/routes/api/community/[id]/+server.ts
CHANGED
|
@@ -159,7 +159,7 @@ export async function DELETE({ params, cookies }: RequestEvent) {
|
|
| 159 |
}
|
| 160 |
})
|
| 161 |
|
| 162 |
-
if (gallery?.userId !== user.sub
|
| 163 |
return json({
|
| 164 |
error: "You are not authorized to delete this gallery"
|
| 165 |
}, { status: 401 })
|
|
|
|
| 159 |
}
|
| 160 |
})
|
| 161 |
|
| 162 |
+
if (gallery?.userId !== user.sub && !process?.env?.SECRET_HF_ADMIN?.includes(user?.sub)) {
|
| 163 |
return json({
|
| 164 |
error: "You are not authorized to delete this gallery"
|
| 165 |
}, { status: 401 })
|