import * as express from 'express'
-import { CONFIG } from '../../initializers'
+import { isSignupAllowed } from '../../helpers'
+import { ServerConfig } from '../../../shared'
const configRouter = express.Router()
// Get the client credentials for the PeerTube front end
function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
- res.json({
- signup: {
- enabled: CONFIG.SIGNUP.ENABLED
+
+ isSignupAllowed().then(allowed => {
+ const json: ServerConfig = {
+ signup: {
+ allowed
+ }
}
+ res.json(json)
})
}