aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/config.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-25 20:17:28 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-25 20:17:28 +0200
commit291e8d3eed88fe714fb74ad897ac2c67347a85ff (patch)
tree20b4f9b8500ab4d9651d2a067fcf2948a6bfc9a4 /server/middlewares/config.ts
parent3d09cdbf90902894c841d0a5ddb35eb772c53b8b (diff)
downloadPeerTube-291e8d3eed88fe714fb74ad897ac2c67347a85ff.tar.gz
PeerTube-291e8d3eed88fe714fb74ad897ac2c67347a85ff.tar.zst
PeerTube-291e8d3eed88fe714fb74ad897ac2c67347a85ff.zip
Add ability to limit user registrations
Diffstat (limited to 'server/middlewares/config.ts')
-rw-r--r--server/middlewares/config.ts20
1 files changed, 0 insertions, 20 deletions
diff --git a/server/middlewares/config.ts b/server/middlewares/config.ts
deleted file mode 100644
index 1481e66cc..000000000
--- a/server/middlewares/config.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1import 'express-validator'
2import * as express from 'express'
3
4import { CONFIG } from '../initializers'
5
6function ensureUserRegistrationEnabled (req: express.Request, res: express.Response, next: express.NextFunction) {
7 const registrationEnabled = CONFIG.SIGNUP.ENABLED
8
9 if (registrationEnabled === true) {
10 return next()
11 }
12
13 return res.status(400).send('User registration is not enabled.')
14}
15
16// ---------------------------------------------------------------------------
17
18export {
19 ensureUserRegistrationEnabled
20}