1 import 'express-validator'
2 import * as express from 'express'
4 import { CONFIG } from '../initializers'
6 function ensureUserRegistrationEnabled (req: express.Request, res: express.Response, next: express.NextFunction) {
7 const registrationEnabled = CONFIG.SIGNUP.ENABLED
9 if (registrationEnabled === true) {
13 return res.status(400).send('User registration is not enabled.')
16 // ---------------------------------------------------------------------------
19 ensureUserRegistrationEnabled