Explorar o código

Added option to disable registration

Kristian Vos %!s(int64=4) %!d(string=hai) anos
pai
achega
6aab07b5e5
Modificáronse 2 ficheiros con 8 adicións e 1 borrados
  1. 2 1
      backend/config/template.json
  2. 6 0
      backend/logic/actions/users.js

+ 2 - 1
backend/config/template.json

@@ -4,7 +4,8 @@
 	"domain": "http://localhost",
 	"frontendPort": 80,
 	"serverDomain": "http://localhost:8080",
-  	"serverPort": 8080,
+	"serverPort": 8080,
+	"registrationDisabled": true,
 	"isDocker": true,
 	"fancyConsole": true,
 	"apis": {

+ 6 - 0
backend/logic/actions/users.js

@@ -322,6 +322,12 @@ module.exports = {
 
         async.waterfall(
             [
+                (next) => {
+                    if (config.get("registrationDisabled") === true)
+                        return next("Registration is not allowed at this time.");
+                    return next();
+                },
+
                 // verify the request with google recaptcha
                 (next) => {
                     if (!db.passwordValid(password))