Add forgot password page

This commit is contained in:
Ephraim Atta-Duncan
2023-06-05 12:50:11 +00:00
parent 447bf0cb76
commit 002b22b1a8
3 changed files with 115 additions and 2 deletions

View File

@ -0,0 +1,34 @@
import Head from "next/head";
import { getUserFromToken } from "@documenso/lib/server";
import ForgotPassword from "../components/forgot-password";
export default function ForgotPasswordPage(props: any) {
return (
<>
<Head>
<title>Reset Password | Documenso</title>
</Head>
<ForgotPassword allowSignup={props.ALLOW_SIGNUP}></ForgotPassword>
</>
);
}
export async function getServerSideProps(context: any) {
const user = await getUserFromToken(context.req, context.res);
if (user)
return {
redirect: {
source: "/login",
destination: "/dashboard",
permanent: false,
},
};
const ALLOW_SIGNUP = process.env.NEXT_PUBLIC_ALLOW_SIGNUP === "true";
return {
props: {
ALLOW_SIGNUP,
},
};
}