2021-09-29 21:33:18 +00:00
|
|
|
import { getSession } from "@lib/auth";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2021-09-29 21:33:18 +00:00
|
|
|
function RedirectPage() {
|
|
|
|
return null;
|
2021-09-28 09:16:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-29 21:33:18 +00:00
|
|
|
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
|
|
|
|
2021-09-29 21:33:18 +00:00
|
|
|
return { redirect: { permanent: false, destination: "/bookings/upcoming" } };
|
2021-06-24 13:36:31 +00:00
|
|
|
}
|
2021-09-29 21:33:18 +00:00
|
|
|
|
|
|
|
export default RedirectPage;
|