feat: add add new config strategy to frontend
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user