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.

Match whole path segments for authenticated partner paths

Rafi233898f686e3
diff --git a/apps/web/lib/middleware/partners.ts b/apps/web/lib/middleware/partners.ts
index 1688bf91b3..9d6a47d800 100644
--- a/apps/web/lib/middleware/partners.ts
+++ b/apps/web/lib/middleware/partners.ts
@@ -29,8 +29,9 @@ export async function PartnersMiddleware(req: NextRequest) {
const user = await getUserViaToken(req);
const isPartnerInvite = req.nextUrl.pathname.endsWith("/invite");
+ // match whole path segments, so program slugs like "overviewai" stay public
const isAuthenticatedPath = AUTHENTICATED_PATHS.some(
- (p) => path === "/" || path.startsWith(p),
+ (p) => path === "/" || path === p || path.startsWith(`${p}/`),
);
const isLoginPath = ["/login", "/register"].some(