mirror of
https://github.com/documenso/documenso
synced 2026-05-05 06:08:21 +00:00
18 lines
451 B
TypeScript
18 lines
451 B
TypeScript
import { NextPageContext } from "next";
|
|
import { getSession } from "next-auth/react";
|
|
|
|
function RedirectPage() {
|
|
return;
|
|
}
|
|
|
|
export async function getServerSideProps(context: NextPageContext) {
|
|
const session = await getSession(context);
|
|
|
|
if (!session?.user?.email) {
|
|
return { redirect: { permanent: false, destination: "/login" } };
|
|
}
|
|
|
|
return { redirect: { permanent: false, destination: "/dashboard" } };
|
|
}
|
|
|
|
export default RedirectPage;
|