summary refs log tree commit diff
path: root/api/src/routes/auth/register.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-01 20:11:05 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-01 20:11:05 +0200
commit17081d4483ffe420c6f5386c8e4e92e72e1b2258 (patch)
tree6d87baddd82d6a925947e764c9b3c52e91b28ae8 /api/src/routes/auth/register.ts
parentMerge branch 'master' of http://github.com/fosscord/fosscord-server (diff)
downloadserver-17081d4483ffe420c6f5386c8e4e92e72e1b2258.tar.xz
:sparkles: registration disabled notice
Diffstat (limited to 'api/src/routes/auth/register.ts')
-rw-r--r--api/src/routes/auth/register.ts9
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`);