2023-02-23 20:02:33 +01:00
|
|
|
import { NextPageContext } from "next";
|
2023-01-11 14:36:59 +01:00
|
|
|
import Head from "next/head";
|
|
|
|
|
import Signup from "../components/signup";
|
|
|
|
|
|
2023-02-23 20:02:33 +01:00
|
|
|
export default function SignupPage(props: { source: string }) {
|
2023-01-11 14:36:59 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Head>
|
2023-01-11 15:22:09 +01:00
|
|
|
<title>Signup | Documenso</title>
|
2023-01-11 14:36:59 +01:00
|
|
|
</Head>
|
2023-02-23 20:02:33 +01:00
|
|
|
<Signup source={props.source}></Signup>
|
2023-01-11 14:36:59 +01:00
|
|
|
</>
|
|
|
|
|
);
|
2022-12-06 19:28:19 +01:00
|
|
|
}
|
2023-02-23 20:02:33 +01:00
|
|
|
|
|
|
|
|
export async function getServerSideProps(context: any) {
|
|
|
|
|
const signupSource: string = context.query["source"];
|
2023-03-19 15:05:33 +01:00
|
|
|
if (process.env.ALLOW_SIGNUP !== "true")
|
2023-03-19 14:59:10 +01:00
|
|
|
return {
|
|
|
|
|
redirect: {
|
|
|
|
|
destination: "/login",
|
|
|
|
|
permanent: false,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-23 20:02:33 +01:00
|
|
|
return {
|
|
|
|
|
props: {
|
|
|
|
|
source: signupSource ? signupSource : "",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|