cal.pub0.org/apps/web/pages/index.tsx

20 lines
530 B
TypeScript
Raw Normal View History

import type { GetServerSidePropsContext } from "next";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
function RedirectPage() {
return;
}
export async function getServerSideProps({ req, res }: GetServerSidePropsContext) {
const session = await getServerSession({ req, res });
if (!session?.user?.id) {
return { redirect: { permanent: false, destination: "/auth/login" } };
}
return { redirect: { permanent: false, destination: "/event-types" } };
}
export default RedirectPage;