aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/users.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index 871233afe..b3466333c 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -4,8 +4,10 @@ import { body, param } from 'express-validator'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' 5import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
6import { 6import {
7 isNoInstanceConfigWarningModal, isNoWelcomeModal, 7 isNoInstanceConfigWarningModal,
8 isNoWelcomeModal,
8 isUserAdminFlagsValid, 9 isUserAdminFlagsValid,
10 isUserAutoPlayNextVideoValid,
9 isUserAutoPlayVideoValid, 11 isUserAutoPlayVideoValid,
10 isUserBlockedReasonValid, 12 isUserBlockedReasonValid,
11 isUserDescriptionValid, 13 isUserDescriptionValid,
@@ -223,6 +225,9 @@ const usersUpdateMeValidator = [
223 body('noWelcomeModal') 225 body('noWelcomeModal')
224 .optional() 226 .optional()
225 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), 227 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'),
228 body('autoPlayNextVideo')
229 .optional()
230 .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'),
226 231
227 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 232 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
228 logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') }) 233 logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') })