mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
19 lines
451 B
TypeScript
19 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;
|