diff options
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 }) |