From e01a4dbd9ae21f5664d191251f10bf8fee623a72 Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Mon, 2 Sep 2024 12:03:45 +0200 Subject: [PATCH] Get config domain from env var --- www/middleware.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/middleware.ts b/www/middleware.ts index c49af350..8f29ac55 100644 --- a/www/middleware.ts +++ b/www/middleware.ts @@ -4,8 +4,8 @@ import { getFiefAuthMiddleware } from "./app/lib/fief"; import { getConfig } from "./app/lib/edgeConfig"; export async function middleware(request: NextRequest) { - const domain = request.nextUrl.hostname; - const config = await getConfig(domain); + const hostname = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname; + const config = await getConfig(hostname); if ( request.nextUrl.pathname.match(