From 01fd5309195e1107b6eb8782d4a351a3c0b6f2dc Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Mon, 1 Jul 2024 20:11:55 +0700 Subject: [PATCH] feat: dev without allow list edge config --- src/middleware.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/middleware.ts b/src/middleware.ts index f435c76b..7117e38f 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -12,7 +12,8 @@ export async function middleware(request: NextRequest) { const origin = request.headers.get("origin") ?? ""; if (!process.env.ALLOWED_LIST_EDGE_CONFIG) { - throw new Error("NEXT_PUBLIC_EDGE_CONFIG is not set"); + console.error("ALLOWED_LIST_EDGE_CONFIG is not set"); + return NextResponse.next(); } const client = createClient(process.env.ALLOWED_LIST_EDGE_CONFIG); const allowedOriginsData = await client.get("allowed-origins");