Files
calendar/apps/web/lib/settings/license-key/new/getServerSideProps.tsx
T
Benny JooandGitHub f0dc3bba17 chore: tech debt clearing - getServerSession has a dead arg: res (#19053)
* remove res from arg list in getServerSession

* remove res from all usages of getServerSession
2025-02-03 00:12:42 -05:00

24 lines
665 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";
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,
}),
});
// Disable this check if we ever make this self serve.
if (session?.user.role !== "ADMIN") {
return {
notFound: true,
} as const;
}
return {
props: {},
};
};