Skip to content

Commit c06dc28

Browse files
authored
Merge pull request #564 from trycompai/main
[comp] Production Deploy
2 parents 0a60168 + de19aa3 commit c06dc28

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/trust/src/middleware.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NextRequest, NextResponse } from "next/server";
22

33
const DOMAIN_TO_ORG_ID_MAP = {
4+
"fba6-145-40-151-14.ngrok-free.app": "org_681e8e3282ad3e9eb78bc58c",
45
"security.trycomp.ai": "org_681e8e3282ad3e9eb78bc58c",
56
"trust.trycomp.ai": null,
67
};
@@ -19,9 +20,9 @@ export async function middleware(request: NextRequest) {
1920
DOMAIN_TO_ORG_ID_MAP[hostname as keyof typeof DOMAIN_TO_ORG_ID_MAP];
2021

2122
if (orgIdForCustomDomain) {
22-
console.log(
23-
`Rewriting ${hostname}${url.pathname} to /${orgIdForCustomDomain}${url.pathname}`,
24-
);
23+
if (url.pathname.startsWith(`/${orgIdForCustomDomain}`)) {
24+
return NextResponse.next();
25+
}
2526
url.pathname = `/${orgIdForCustomDomain}${url.pathname}`;
2627
return NextResponse.rewrite(url);
2728
}

0 commit comments

Comments
 (0)