aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/users.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index bc8607523..c6977fcd9 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -9,14 +9,13 @@ import { UserRegister } from '../../../shared/models/users/user-register.model'
9import { toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' 9import { toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
10import { isThemeNameValid } from '../../helpers/custom-validators/plugins' 10import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
11import { 11import {
12 isNoInstanceConfigWarningModal,
13 isNoWelcomeModal,
14 isUserAdminFlagsValid, 12 isUserAdminFlagsValid,
15 isUserAutoPlayNextVideoValid, 13 isUserAutoPlayNextVideoValid,
16 isUserAutoPlayVideoValid, 14 isUserAutoPlayVideoValid,
17 isUserBlockedReasonValid, 15 isUserBlockedReasonValid,
18 isUserDescriptionValid, 16 isUserDescriptionValid,
19 isUserDisplayNameValid, 17 isUserDisplayNameValid,
18 isUserNoModal,
20 isUserNSFWPolicyValid, 19 isUserNSFWPolicyValid,
21 isUserPasswordValid, 20 isUserPasswordValid,
22 isUserPasswordValidOrEmpty, 21 isUserPasswordValidOrEmpty,
@@ -251,12 +250,17 @@ const usersUpdateMeValidator = [
251 body('theme') 250 body('theme')
252 .optional() 251 .optional()
253 .custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'), 252 .custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'),
253
254 body('noInstanceConfigWarningModal') 254 body('noInstanceConfigWarningModal')
255 .optional() 255 .optional()
256 .custom(v => isNoInstanceConfigWarningModal(v)).withMessage('Should have a valid noInstanceConfigWarningModal boolean'), 256 .custom(v => isUserNoModal(v)).withMessage('Should have a valid noInstanceConfigWarningModal boolean'),
257 body('noWelcomeModal') 257 body('noWelcomeModal')
258 .optional() 258 .optional()
259 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), 259 .custom(v => isUserNoModal(v)).withMessage('Should have a valid noWelcomeModal boolean'),
260 body('noAccountSetupWarningModal')
261 .optional()
262 .custom(v => isUserNoModal(v)).withMessage('Should have a valid noAccountSetupWarningModal boolean'),
263
260 body('autoPlayNextVideo') 264 body('autoPlayNextVideo')
261 .optional() 265 .optional()
262 .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'), 266 .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'),