2023-03-10 23:45:24 +00:00
|
|
|
import type { GetServerSidePropsContext } from "next";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2023-03-10 23:45:24 +00:00
|
|
|
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
2022-02-11 22:20:10 +00:00
|
|
|
|
2021-08-02 18:04:06 +00:00
|
|
|
function RedirectPage() {
|
2021-09-23 08:49:17 +00:00
|
|
|
return;
|
2021-07-15 14:10:26 +00:00
|
|
|
}
|
2021-08-02 18:04:06 +00:00
|
|
|
|
2023-03-10 23:45:24 +00:00
|
|
|
export async function getServerSideProps({ req, res }: GetServerSidePropsContext) {
|
|
|
|
const session = await getServerSession({ req, res });
|
|
|
|
|
2021-09-23 08:49:17 +00:00
|
|
|
if (!session?.user?.id) {
|
|
|
|
return { redirect: { permanent: false, destination: "/auth/login" } };
|
2021-08-02 18:04:06 +00:00
|
|
|
}
|
2021-09-23 08:49:17 +00:00
|
|
|
|
|
|
|
return { redirect: { permanent: false, destination: "/event-types" } };
|
|
|
|
}
|
2021-08-02 18:04:06 +00:00
|
|
|
|
|
|
|
export default RedirectPage;
|