]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/middlewares/config.ts
Fix overflow on embed for firefox
[github/Chocobozzz/PeerTube.git] / server / middlewares / config.ts
CommitLineData
ba44fa19
C
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}