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

19 lines
460 B
TypeScript
Raw Normal View History

import { NextPageContext } from "next";
import { getSession } from "@lib/auth";
function RedirectPage() {
return null;
}
export async function getServerSideProps(context: NextPageContext) {
const session = await getSession(context);
if (!session?.user?.id) {
return { redirect: { permanent: false, destination: "/auth/login" } };
}
2021-07-17 12:30:29 +00:00
return { redirect: { permanent: false, destination: "/bookings/upcoming" } };
2021-06-24 13:36:31 +00:00
}
export default RedirectPage;