Get config domain from env var

This commit is contained in:
2024-09-02 12:03:45 +02:00
parent bda4e1cdc0
commit e01a4dbd9a

View File

@@ -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(