feat: add add new config strategy to frontend

This commit is contained in:
Elias Schneider
2022-11-28 17:50:36 +01:00
parent 1b5e53ff7e
commit 493705e4ef
20 changed files with 183 additions and 102 deletions

View File

@@ -1,17 +1,16 @@
import getConfig from "next/config";
import { useRouter } from "next/router";
import AuthForm from "../../components/auth/AuthForm";
import Meta from "../../components/Meta";
import useConfig from "../../hooks/config.hook";
import useUser from "../../hooks/user.hook";
const { publicRuntimeConfig } = getConfig();
const SignUp = () => {
const config = useConfig();
const user = useUser();
const router = useRouter();
if (user) {
router.replace("/");
} else if (publicRuntimeConfig.ALLOW_REGISTRATION == "false") {
} else if (config.get("allowRegistration") == "false") {
router.replace("/auth/signIn");
} else {
return (