Files
sign/apps/web/pages/index.tsx

19 lines
451 B
TypeScript
Raw Normal View History

2023-01-11 19:13:59 +01:00
import { NextPageContext } from "next";
import { getSession } from "next-auth/react";
2022-11-24 12:28:46 +01:00
2023-01-11 19:13:59 +01:00
function RedirectPage() {
return;
}
2022-11-14 23:12:51 +01:00
2023-01-11 19:13:59 +01:00
export async function getServerSideProps(context: NextPageContext) {
const session = await getSession(context);
2022-11-14 23:12:51 +01:00
2023-01-11 19:13:59 +01:00
if (!session?.user?.email) {
return { redirect: { permanent: false, destination: "/login" } };
}
return { redirect: { permanent: false, destination: "/dashboard" } };
}
export default RedirectPage;