diff options
Diffstat (limited to 'server/lib/signup.ts')
-rw-r--r-- | server/lib/signup.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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: { | |||
15 | const { signupMode } = options | 15 | const { signupMode } = options |
16 | 16 | ||
17 | if (CONFIG.SIGNUP.ENABLED === false) { | 17 | if (CONFIG.SIGNUP.ENABLED === false) { |
18 | return { allowed: false } | 18 | return { allowed: false, errorMessage: 'User registration is not allowed' } |
19 | } | 19 | } |
20 | 20 | ||
21 | if (signupMode === 'direct-registration' && CONFIG.SIGNUP.REQUIRES_APPROVAL === true) { | 21 | if (signupMode === 'direct-registration' && CONFIG.SIGNUP.REQUIRES_APPROVAL === true) { |
22 | return { allowed: false } | 22 | return { allowed: false, errorMessage: 'User registration requires approval' } |
23 | } | 23 | } |
24 | 24 | ||
25 | // No limit and signup is enabled | 25 | // No limit and signup is enabled |
@@ -29,7 +29,7 @@ async function isSignupAllowed (options: { | |||
29 | 29 | ||
30 | const totalUsers = await UserModel.countTotal() | 30 | const totalUsers = await UserModel.countTotal() |
31 | 31 | ||
32 | return { allowed: totalUsers < CONFIG.SIGNUP.LIMIT } | 32 | return { allowed: totalUsers < CONFIG.SIGNUP.LIMIT, errorMessage: 'User limit is reached on this instance' } |
33 | } | 33 | } |
34 | 34 | ||
35 | function isSignupAllowedForCurrentIP (ip: string) { | 35 | function isSignupAllowedForCurrentIP (ip: string) { |