diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-25 16:23:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-25 16:23:44 +0200 |
commit | c8861d5dc0436ef4342ce517241e3591fa256a13 (patch) | |
tree | ca47c09d1f7f1e2aa62c684d576faa938eb47af7 /server/middlewares/validators/users.ts | |
parent | b4c19345c19b0891142c69308cd9447f2161188c (diff) | |
download | PeerTube-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.ts | 7 |
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 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import * as Bluebird from 'bluebird' |
2 | import * as express from 'express' | 2 | import * as express from 'express' |
3 | import 'express-validator' | 3 | import { body, param } from 'express-validator' |
4 | import { body, param } from 'express-validator/check' | ||
5 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
6 | import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' | 5 | import { isIdOrUUIDValid, toIntOrNull } from '../../helpers/custom-validators/misc' |
7 | import { | 6 | import { |
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 }) |