From 4e9a98669fc81b236ff474e101402d6cff81cd1b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 5 Jun 2023 08:53:31 +0200 Subject: More specific message when signup is not allowed --- server/lib/signup.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib') diff --git a/server/lib/signup.ts b/server/lib/signup.ts index f19232621..6702c22cb 100644 --- a/server/lib/signup.ts +++ b/server/lib/signup.ts @@ -15,11 +15,11 @@ async function isSignupAllowed (options: { const { signupMode } = options if (CONFIG.SIGNUP.ENABLED === false) { - return { allowed: false } + return { allowed: false, errorMessage: 'User registration is not allowed' } } if (signupMode === 'direct-registration' && CONFIG.SIGNUP.REQUIRES_APPROVAL === true) { - return { allowed: false } + return { allowed: false, errorMessage: 'User registration requires approval' } } // No limit and signup is enabled @@ -29,7 +29,7 @@ async function isSignupAllowed (options: { const totalUsers = await UserModel.countTotal() - return { allowed: totalUsers < CONFIG.SIGNUP.LIMIT } + return { allowed: totalUsers < CONFIG.SIGNUP.LIMIT, errorMessage: 'User limit is reached on this instance' } } function isSignupAllowedForCurrentIP (ip: string) { -- cgit v1.2.3