mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-29 09:18:59 +02:00
Add disable registration option
This commit is contained in:
@@ -3,12 +3,16 @@ import React, { useContext } from "react";
|
||||
import AuthForm from "../../components/auth/AuthForm";
|
||||
import Meta from "../../components/Meta";
|
||||
import { IsSignedInContext } from "../../utils/auth.util";
|
||||
import { useConfig } from "../../utils/config.util";
|
||||
|
||||
const SignUp = () => {
|
||||
const isSignedIn = useContext(IsSignedInContext);
|
||||
const config = useConfig();
|
||||
const router = useRouter();
|
||||
if (isSignedIn) {
|
||||
router.replace("/");
|
||||
} else if (config.DISABLE_REGISTRATION) {
|
||||
router.replace("/auth/signIn");
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user