Add 21 files, update 16 files, rename 1 file

This commit is contained in:
[dyad] committed 2026-08-02 17:26:49 +02:00
1 parent b9e4ed4dfc
commit 278293b397
39 files changed
+2434 -61

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import { NextResponse, type NextRequest } from 'next/server';
import { isCsrfProtectedRequest, isTrustedRequestOrigin } from '@/lib/csrf';
export function middleware(request: NextRequest) {
if (isCsrfProtectedRequest(request) && !isTrustedRequestOrigin(request)) {
return NextResponse.json({ error: 'Invalid request origin' }, { status: 403 });
}
return NextResponse.next();
}
export const config = {
matcher: ['/api/:path*'],
};