Skip to content

Scheduling infrastructure for absolutely everyone.

fix: middleware config matcher (#20450)

Benny Joo21e7ac3cbe77
diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts
index b44f38d67c8..469e7aa0016 100644
--- a/apps/web/middleware.ts
+++ b/apps/web/middleware.ts
@@ -174,6 +174,8 @@ function responseWithHeaders({ url, res, req }: { url: URL; res: NextResponse; r
export const config = {
// Next.js Doesn't support spread operator in config matcher, so, we must list all paths explicitly here.
// https://github.com/vercel/next.js/discussions/42458
+ // WARNING: DO NOT ADD AN ENDING SLASH "/" TO THE PATHS BELOW
+ // THIS WILL MAKE THEM NOT MATCH AND HENCE NOT HIT MIDDLEWARE
matcher: [
"/403",
"/500",
@@ -204,10 +206,16 @@ export const config = {
"/booking/:path*",
"/payment/:path*",
"/routing-forms/:path*",
- "/team/:path*",
- "/org/:path*",
- "/:user/:type/",
- "/:user/",
+ "/org/:orgSlug/instant-meeting/team/:slug/:type",
+ "/org/:orgSlug/team/:slug/:type",
+ "/org/:orgSlug/team/:slug",
+ "/org/:orgSlug/:user/:type",
+ "/org/:orgSlug/:user",
+ "/org/:orgSlug",
+ "/team/:slug/:type",
+ "/team/:slug",
+ "/:user/:type",
+ "/:user",
],
};