aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-25 16:23:44 +0200
committerChocobozzz <me@florianbigard.com>2019-07-25 16:23:44 +0200
commitc8861d5dc0436ef4342ce517241e3591fa256a13 (patch)
treeca47c09d1f7f1e2aa62c684d576faa938eb47af7 /server/middlewares/validators/users.ts
parentb4c19345c19b0891142c69308cd9447f2161188c (diff)
downloadPeerTube-c8861d5dc0436ef4342ce517241e3591fa256a13.tar.gz
PeerTube-c8861d5dc0436ef4342ce517241e3591fa256a13.tar.zst
PeerTube-c8861d5dc0436ef4342ce517241e3591fa256a13.zip
Fix express validator
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r--server/middlewares/validators/users.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index 7002de20d..db03dc231 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -1,9 +1,8 @@
1import * as Bluebird from 'bluebird' 1import * as Bluebird from 'bluebird'
2import * as express from 'express' 2import * as express from 'express'
3import 'express-validator' 3import { body, param } from 'express-validator'
4import { body, param } from 'express-validator/check'
5import { omit } from 'lodash' 4import { omit } from 'lodash'
6import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' 5import { isIdOrUUIDValid, toIntOrNull } from '../../helpers/custom-validators/misc'
7import { 6import {
8 isUserAdminFlagsValid, 7 isUserAdminFlagsValid,
9 isUserAutoPlayVideoValid, 8 isUserAutoPlayVideoValid,
@@ -358,7 +357,7 @@ const usersVerifyEmailValidator = [
358 .not().isEmpty().withMessage('Should have a valid verification string'), 357 .not().isEmpty().withMessage('Should have a valid verification string'),
359 body('isPendingEmail') 358 body('isPendingEmail')
360 .optional() 359 .optional()
361 .toBoolean(), 360 .customSanitizer(toIntOrNull),
362 361
363 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 362 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
364 logger.debug('Checking usersVerifyEmail parameters', { parameters: req.params }) 363 logger.debug('Checking usersVerifyEmail parameters', { parameters: req.params })