From 1d77d80db9fd32d17908ac07244d004ded0d7384 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 8 Dec 2023 18:47:59 -1000 Subject: [PATCH] feat: Block user registration endpoint is registrations are disabled --- server/api/api/v1/accounts/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/api/api/v1/accounts/index.ts b/server/api/api/v1/accounts/index.ts index dc88d581..a0d20fec 100644 --- a/server/api/api/v1/accounts/index.ts +++ b/server/api/api/v1/accounts/index.ts @@ -36,6 +36,15 @@ export default async (req: Request): Promise => { const config = getConfig(); + if (!config.signups.registration) { + return jsonResponse( + { + error: "Registration is disabled", + }, + 422 + ); + } + const errors: { details: Record< string,