From 17081d4483ffe420c6f5386c8e4e92e72e1b2258 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Fri, 1 Oct 2021 20:11:05 +0200 Subject: :sparkles: registration disabled notice --- api/src/routes/auth/register.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'api/src/routes/auth/register.ts') diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts index 9c058399..75fa68c3 100644 --- a/api/src/routes/auth/register.ts +++ b/api/src/routes/auth/register.ts @@ -50,6 +50,15 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re const { register, security } = Config.get(); const ip = getIpAdress(req); + if (register.disabled) { + throw FieldErrors({ + email: { + code: "DISABLED", + message: "registration is disabled on this instance" + } + }); + } + if (register.blockProxies) { if (isProxy(await IPAnalysis(ip))) { console.log(`proxy ${ip} blocked from registration`); -- cgit 1.4.1