Files
swiss-datashare/frontend/src/pages/auth/signUp.tsx

25 lines
607 B
TypeScript
Raw Normal View History

2022-04-25 15:15:17 +02:00
import { useRouter } from "next/router";
2022-12-01 23:07:49 +01:00
import SignUpForm from "../../components/auth/SignUpForm";
2022-04-28 15:31:37 +02:00
import Meta from "../../components/Meta";
import useConfig from "../../hooks/config.hook";
import useUser from "../../hooks/user.hook";
2022-04-25 15:15:17 +02:00
const SignUp = () => {
const config = useConfig();
const user = useUser();
2022-04-25 15:15:17 +02:00
const router = useRouter();
if (user) {
2022-04-25 15:15:17 +02:00
router.replace("/");
} else if (!config.get("ALLOW_REGISTRATION")) {
2022-05-02 11:19:24 +02:00
router.replace("/auth/signIn");
2022-04-25 15:15:17 +02:00
} else {
2022-04-28 15:31:37 +02:00
return (
<>
<Meta title="Sign Up" />
2022-12-01 23:07:49 +01:00
<SignUpForm />
2022-04-28 15:31:37 +02:00
</>
);
2022-04-25 15:15:17 +02:00
}
};
export default SignUp;