diff --git a/app/upload/upload/route.ts b/app/upload/upload/route.ts index ba9e89f06..1f52c4235 100644 --- a/app/upload/upload/route.ts +++ b/app/upload/upload/route.ts @@ -10,7 +10,12 @@ export async function POST(request: Request): Promise { // Only users with the `assetUpload` feature flag may upload const user = await getUserProfile(id); if (!user?.featureFlags.includes("assetUpload")) { - return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); + return NextResponse.json( + { + error: `Feature flag 'assetUpload' not set for user '${user?.name}'.`, + }, + { status: 403 }, + ); } const body = (await request.json()) as HandleUploadBody;