diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/src/routes/auth/register.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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`); |