calcom/pages/index.tsx
Omar López 5d0ba3dafc
The road to zero TypeScript errors (#1756)
* Type fixes

* Type fixes

* Type fixes

* Type fixes

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-10 10:44:46 +00:00

17 lines
448 B
TypeScript

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