Files
sign/apps/web/pages/forgot-password.tsx

33 lines
707 B
TypeScript
Raw Normal View History

2023-06-09 03:55:30 +00:00
import { GetServerSideProps, GetServerSidePropsContext } from "next";
2023-06-05 12:50:11 +00:00
import Head from "next/head";
import { getUserFromToken } from "@documenso/lib/server";
import ForgotPassword from "../components/forgot-password";
2023-06-07 10:37:47 +00:00
export default function ForgotPasswordPage() {
2023-06-05 12:50:11 +00:00
return (
<>
<Head>
2023-06-05 14:17:45 +00:00
<title>Forgot Password | Documenso</title>
2023-06-05 12:50:11 +00:00
</Head>
2023-06-07 10:37:47 +00:00
<ForgotPassword />
2023-06-05 12:50:11 +00:00
</>
);
}
2023-06-09 03:55:30 +00:00
export async function getServerSideProps({ req }: GetServerSidePropsContext) {
const user = await getUserFromToken(req);
2023-06-05 12:50:11 +00:00
if (user)
return {
redirect: {
source: "/login",
destination: "/dashboard",
permanent: false,
},
};
return {
2023-06-07 10:37:47 +00:00
props: {},
2023-06-05 12:50:11 +00:00
};
}