Allow signup disabling in account.ts

This commit is contained in:
Mathias Wagner
2024-07-22 13:04:55 +02:00
parent 26636c3b54
commit 90a76a8815

View File

@ -18,6 +18,9 @@ app.get("/me", authenticate, async (req: Request, res: Response) => {
});
app.post("/register", async (req: Request, res: Response) => {
if (process.env.DISABLE_SIGNUPS === "true")
return sendError(res, 400, 1094, "Signups are disabled on this server.");
if (validateSchema(res, registerValidation, req.body)) return;
const account = await createAccount(req.body);