diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-05 08:53:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-05 08:53:31 +0200 |
commit | 4e9a98669fc81b236ff474e101402d6cff81cd1b (patch) | |
tree | 117a447fa43e5eef3207990685056361c70f3f21 /server/lib | |
parent | a45e2971f786ede5cfa88118e12d2f5f09eb0286 (diff) | |
download | PeerTube-4e9a98669fc81b236ff474e101402d6cff81cd1b.tar.gz PeerTube-4e9a98669fc81b236ff474e101402d6cff81cd1b.tar.zst PeerTube-4e9a98669fc81b236ff474e101402d6cff81cd1b.zip |
More specific message when signup is not allowed
Diffstat (limited to 'server/lib')
-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) { |