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

17 lines
402 B
TypeScript
Raw Normal View History

import { getSession } from "@lib/auth";
function RedirectPage() {
return null;
}
export async function getServerSideProps(context) {
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;