This commit is contained in:
echo 2026-06-22 23:39:19 +02:00
parent 677322db7e
commit da84f7b968

View File

@ -28,7 +28,7 @@ export default clerkMiddleware(async (auth, req: NextRequest) => {
}
const subdomain = getSubdomain(req);
if (subdomain) {
if (subdomain && !req.nextUrl.pathname.startsWith("/api")) {
const url = req.nextUrl.clone();
url.pathname = `/${subdomain}${url.pathname === "/" ? "" : url.pathname}`;
return NextResponse.rewrite(url);