forked from fahrPool/fahrPool
17 lines
635 B
TypeScript
17 lines
635 B
TypeScript
import { NextResponse, type NextRequest } from "next/server";
|
|
import { updateSession } from "@/lib/supabase/middleware";
|
|
|
|
export async function middleware(request: NextRequest) {
|
|
// Interne Endpunkte mit eigener Authentifizierung (Shared Secret) umgehen
|
|
// das Supabase-Session-Gating -- der pg_cron-Aufruf an diese Route traegt
|
|
// kein Session-Cookie.
|
|
if (request.nextUrl.pathname === "/api/notifications/dispatch") {
|
|
return NextResponse.next();
|
|
}
|
|
return await updateSession(request);
|
|
}
|
|
|
|
export const config = {
|
|
matcher: ["/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|wasm)$).*)"],
|
|
};
|