added the ability to disable registration

This commit is contained in:
daniel31x13
2023-09-28 19:07:25 +03:30
parent 7585d52750
commit fdcae013c6
5 changed files with 132 additions and 115 deletions
+4
View File
@@ -20,6 +20,10 @@ export default async function Index(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
if (process.env.NEXT_PUBLIC_DISABLE_REGISTRATION === "true") {
return res.status(400).json({ response: "Registration is disabled." });
}
const body: User = req.body;
const checkHasEmptyFields = emailEnabled