fix(seo): prevent booking confirmation pages from being indexed (#26058)

Booking confirmation pages contain PII (names, emails, phone numbers)
and should not be indexed by search engines

- Add robots noindex to /booking/[uid]/page.tsx
- Add robots noindex to /booking/[uid]/embed/page.tsx

Follows same pattern as not-found.tsx
This commit is contained in:
Pedro Castro
2025-12-19 13:34:49 -03:00
committed by GitHub
parent 90a83a611c
commit af4a10c008
2 changed files with 18 additions and 3 deletions
@@ -13,6 +13,13 @@ import {
type PageProps as ClientPageProps,
} from "~/bookings/views/bookings-single-view.getServerSideProps";
export const metadata = {
robots: {
index: false,
follow: false,
},
};
const getEmbedData = withEmbedSsrAppDir<ClientPageProps>(getServerSideProps);
const ServerPage = async ({ params, searchParams }: ServerPageProps) => {
@@ -16,13 +16,15 @@ import {
type PageProps as ClientPageProps,
} from "~/bookings/views/bookings-single-view.getServerSideProps";
const getData = withAppDirSsr<ClientPageProps>(getServerSideProps);
export const generateMetadata = async ({ params, searchParams }: _PageProps) => {
const { bookingInfo, eventType, recurringBookings, orgSlug } = await getData(
buildLegacyCtx(await headers(), await cookies(), await params, await searchParams)
);
const needsConfirmation = bookingInfo.status === BookingStatus.PENDING && eventType.requiresConfirmation;
return await _generateMetadata(
const metadata = await _generateMetadata(
(t) =>
t(`booking_${needsConfirmation ? "submitted" : "confirmed"}${recurringBookings ? "_recurring" : ""}`),
(t) =>
@@ -31,9 +33,15 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) =>
getOrgFullOrigin(orgSlug),
`/booking/${(await params).uid}`
);
};
const getData = withAppDirSsr<ClientPageProps>(getServerSideProps);
return {
...metadata,
robots: {
index: false,
follow: false,
},
};
};
const ServerPage = async ({ params, searchParams }: _PageProps) => {
const context = buildLegacyCtx(await headers(), await cookies(), await params, await searchParams);