]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/signup.ts
Translated using Weblate (Basque)
[github/Chocobozzz/PeerTube.git] / server / helpers / signup.ts
index 5eb56b3cf6c2779e065b90edbc89aef45a360721..7c73f7c5c02efcd8358a13bcef70a670e6c80baa 100644 (file)
@@ -4,19 +4,19 @@ import { CONFIG } from '../initializers/config'
 
 const isCidr = require('is-cidr')
 
-async function isSignupAllowed () {
+async function isSignupAllowed (): Promise<{ allowed: boolean, errorMessage?: string }> {
   if (CONFIG.SIGNUP.ENABLED === false) {
-    return false
+    return { allowed: false }
   }
 
   // No limit and signup is enabled
   if (CONFIG.SIGNUP.LIMIT === -1) {
-    return true
+    return { allowed: true }
   }
 
   const totalUsers = await UserModel.countTotal()
 
-  return totalUsers < CONFIG.SIGNUP.LIMIT
+  return { allowed: totalUsers < CONFIG.SIGNUP.LIMIT }
 }
 
 function isSignupAllowedForCurrentIP (ip: string) {