Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix routing bug

Steven Tey8af85c5534ba
diff --git a/lib/middleware/admin.ts b/lib/middleware/admin.ts
index a7466a56c4..0eb5febaca 100644
--- a/lib/middleware/admin.ts
+++ b/lib/middleware/admin.ts
@@ -34,5 +34,7 @@ export default async function AdminMiddleware(req: NextRequest) {
return NextResponse.redirect(new URL(`/login`, req.url));
}
- return NextResponse.rewrite(new URL(`/admin${path}`, req.url));
+ return NextResponse.rewrite(
+ new URL(`/admin${path === "/" ? "" : path}`, req.url),
+ );
}