From 28d1863be0b21663a50d54e465dbf747500b61eb Mon Sep 17 00:00:00 2001 From: swve Date: Wed, 12 Apr 2023 23:53:28 +0200 Subject: [PATCH] wip: remove starts with function --- front/middleware.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/front/middleware.ts b/front/middleware.ts index baeb1761..b158bf9f 100644 --- a/front/middleware.ts +++ b/front/middleware.ts @@ -35,14 +35,7 @@ export default function middleware(req: NextRequest) { return NextResponse.rewrite(url, { headers: { orgslug: currentHost } }); } - if (url.pathname.startsWith("/organizations")) { - if (!isSelfHosted) { - currentHost = ""; - } - url.pathname = url.pathname.replace("/organizations", `/organizations${currentHost}`).replace("localhost:3000", ""); - - return NextResponse.rewrite(url); - } + if (isSelfHosted) { currentHost = defaultOrg || currentHost;