diff options
Diffstat (limited to 'app/Controllers/Http/UserController.js')
-rw-r--r-- | app/Controllers/Http/UserController.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/Controllers/Http/UserController.js b/app/Controllers/Http/UserController.js index 979e78a..e580e49 100644 --- a/app/Controllers/Http/UserController.js +++ b/app/Controllers/Http/UserController.js | |||
@@ -38,6 +38,13 @@ class UserController { | |||
38 | response, | 38 | response, |
39 | auth, | 39 | auth, |
40 | }) { | 40 | }) { |
41 | if (Env.get('IS_REGISTRATION_ENABLED') == 'false') { // eslint-disable-line eqeqeq | ||
42 | return response.status(401).send({ | ||
43 | message: 'Registration is disabled on this server', | ||
44 | status: 401, | ||
45 | }); | ||
46 | } | ||
47 | |||
41 | // Validate user input | 48 | // Validate user input |
42 | const validation = await validateAll(request.all(), { | 49 | const validation = await validateAll(request.all(), { |
43 | firstname: 'required', | 50 | firstname: 'required', |
@@ -197,6 +204,13 @@ class UserController { | |||
197 | request, | 204 | request, |
198 | response, | 205 | response, |
199 | }) { | 206 | }) { |
207 | if (Env.get('IS_REGISTRATION_ENABLED') == 'false') { // eslint-disable-line eqeqeq | ||
208 | return response.status(401).send({ | ||
209 | message: 'Registration is disabled on this server', | ||
210 | status: 401, | ||
211 | }); | ||
212 | } | ||
213 | |||
200 | // Validate user input | 214 | // Validate user input |
201 | const validation = await validateAll(request.all(), { | 215 | const validation = await validateAll(request.all(), { |
202 | email: 'required|email|unique:users,email', | 216 | email: 'required|email|unique:users,email', |