aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/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/controllers/api/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/controllers/api/config.ts')
-rw-r--r--server/controllers/api/config.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 3e9aa77a5..f02a2bc58 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2 2
3import { CONFIG } from '../../initializers' 3import { isSignupAllowed } from '../../helpers'
4import { ServerConfig } from '../../../shared' 4import { ServerConfig } from '../../../shared'
5 5
6const configRouter = express.Router() 6const configRouter = express.Router()
@@ -9,12 +9,15 @@ configRouter.get('/', getConfig)
9 9
10// Get the client credentials for the PeerTube front end 10// Get the client credentials for the PeerTube front end
11function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { 11function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
12 const json: ServerConfig = { 12
13 signup: { 13 isSignupAllowed().then(allowed => {
14 enabled: CONFIG.SIGNUP.ENABLED 14 const json: ServerConfig = {
15 signup: {
16 allowed
17 }
15 } 18 }
16 } 19 res.json(json)
17 res.json(json) 20 })
18} 21}
19 22
20// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------