File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11import { NextRequest , NextResponse } from "next/server" ;
22
33const 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 }
You can’t perform that action at this time.
0 commit comments