Files
calendar/apps/web/lib/settings/license-key/new/getServerSideProps.tsx
T
Amit SharmaandGitHub f5b9b6b0f9 feat: store ads clickid when creating an account (#25763)
* feat: store ads clickid when creating an account

* fix: type check

* fix: google campaignId not being added to stripe

* remove tracking in stripe app
2025-12-22 23:29:51 +05:30

26 lines
802 B
TypeScript

import type { GetServerSidePropsContext } from "next";
import { getServerSession } from "@calcom/feature-auth/lib/getServerSession";
import { getOptions } from "@calcom/feature-auth/lib/next-auth-options";
import { getTrackingFromCookies } from "@calcom/lib/tracking";
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const session = await getServerSession({
req: context.req,
authOptions: getOptions({
getDubId: () => context.req.cookies.dub_id || context.req.cookies.dclid,
getTrackingData: () => getTrackingFromCookies(context.req.cookies),
}),
});
// Disable this check if we ever make this self serve.
if (session?.user.role !== "ADMIN") {
return {
notFound: true,
} as const;
}
return {
props: {},
};
};