fix: DSGVO-Findings 5+7+6 — Tenant-Guard, APP_URL-Pflichtcheck, Constraint-Migration
- getTenantId wirft bei fehlendem Header statt silent fallback auf 'default' - Alle API-Routes fangen den Fehler ab und antworten mit 401 - Worker gibt err() zurück wenn APP_URL nicht konfiguriert ist - Migration: recipient_has_one Constraint schließt NULL/NULL-Zeilen aus Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,10 @@ import { checkSuppression } from '../../../../../server/suppression/check'
|
||||
import { getTenantId } from '../../../../../lib/tenant-header'
|
||||
|
||||
export async function POST(req: NextRequest, { params }: { params: { id: string } }) {
|
||||
const tenantId = getTenantId(req)
|
||||
let tenantId: string
|
||||
try { tenantId = getTenantId(req) } catch {
|
||||
return NextResponse.json({ error: 'Tenant nicht identifizierbar' }, { status: 401 })
|
||||
}
|
||||
|
||||
const campaignResult = await getCampaign(tenantId, params.id)
|
||||
if (!campaignResult.ok) {
|
||||
|
||||
Reference in New Issue
Block a user