chore: remove org/team booking routes from middleware (#19349)
* chore: remove user routes from middleware * chore: remove org and team routes from middleware
This commit is contained in:
1 parent
8714dda047
commit
8a4b03833d
6 files changed
+20
-15
No files matched your search
@@ -6,7 +6,7 @@ import { cookies, headers } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps";
|
||||
|
||||
import type { PageProps as TeamTypePageProps } from "~/team/type-view";
|
||||
@@ -37,12 +37,14 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
|
||||
})),
|
||||
],
|
||||
};
|
||||
const decodedParams = decodeParams(params);
|
||||
const metadata = await generateMeetingMetadata(
|
||||
meeting,
|
||||
(t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`,
|
||||
(t) => `${rescheduleUid ? t("reschedule") : ""} ${title}`,
|
||||
isBrandingHidden,
|
||||
getOrgFullOrigin(eventData?.entity.orgSlug ?? null)
|
||||
getOrgFullOrigin(eventData?.entity.orgSlug ?? null),
|
||||
`/${decodedParams.user}/${decodedParams.type}`
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { cookies, headers } from "next/headers";
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/getServerSideProps";
|
||||
|
||||
import type { PageProps as TeamPageProps } from "~/team/team-view";
|
||||
@@ -31,14 +31,15 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
|
||||
image: getOrgOrTeamAvatar(team),
|
||||
},
|
||||
};
|
||||
|
||||
const decodedParams = decodeParams(params);
|
||||
return {
|
||||
...(await generateMeetingMetadata(
|
||||
meeting,
|
||||
(t) => team.name ?? t("nameless_team"),
|
||||
(t) => team.name ?? t("nameless_team"),
|
||||
false,
|
||||
getOrgFullOrigin(currentOrgDomain ?? null)
|
||||
getOrgFullOrigin(currentOrgDomain ?? null),
|
||||
`/${decodedParams.user}`
|
||||
)),
|
||||
robots: {
|
||||
index: isSEOIndexable,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { headers, cookies } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/org/[orgSlug]/instant-meeting/team/[slug]/[type]/getServerSideProps";
|
||||
|
||||
import type { Props } from "~/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-meeting-view";
|
||||
@@ -30,12 +30,14 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) =>
|
||||
})),
|
||||
],
|
||||
};
|
||||
const decodedParams = decodeParams(params);
|
||||
const metadata = await generateMeetingMetadata(
|
||||
meeting,
|
||||
() => `${title} | ${profileName}`,
|
||||
() => `${title}`,
|
||||
isBrandingHidden,
|
||||
getOrgFullOrigin(eventData?.entity.orgSlug ?? null)
|
||||
getOrgFullOrigin(eventData?.entity.orgSlug ?? null),
|
||||
`/instant-meeting/team/${decodedParams.slug}/${decodedParams.type}`
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { cookies, headers } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps";
|
||||
|
||||
import LegacyPage from "~/team/type-view";
|
||||
@@ -30,13 +30,14 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
|
||||
})),
|
||||
],
|
||||
};
|
||||
|
||||
const decodedParams = decodeParams(params);
|
||||
const metadata = await generateMeetingMetadata(
|
||||
meeting,
|
||||
(t) => `${booking?.uid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`,
|
||||
(t) => `${booking?.uid ? t("reschedule") : ""} ${title}`,
|
||||
isBrandingHidden,
|
||||
getOrgFullOrigin(eventData.entity.orgSlug ?? null)
|
||||
getOrgFullOrigin(eventData.entity.orgSlug ?? null),
|
||||
`/team/${decodedParams.slug}/${decodedParams.type}`
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { cookies, headers } from "next/headers";
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps";
|
||||
|
||||
import type { PageProps } from "~/team/team-view";
|
||||
@@ -25,13 +25,14 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) =>
|
||||
image: getOrgOrTeamAvatar(team),
|
||||
},
|
||||
};
|
||||
|
||||
const decodedParams = decodeParams(params);
|
||||
const metadata = await generateMeetingMetadata(
|
||||
meeting,
|
||||
(t) => team.name || t("nameless_team"),
|
||||
(t) => team.name || t("nameless_team"),
|
||||
false,
|
||||
getOrgFullOrigin(currentOrgDomain ?? null)
|
||||
getOrgFullOrigin(currentOrgDomain ?? null),
|
||||
`/team/${decodedParams.slug}`
|
||||
);
|
||||
return {
|
||||
...metadata,
|
||||
|
||||
@@ -170,8 +170,6 @@ export const config = {
|
||||
"/booking/:path*",
|
||||
"/payment/:path*",
|
||||
"/routing-forms/:path*",
|
||||
"/team/:path*",
|
||||
"/org/:path*",
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user