diff options
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 947ed36c3..df7f77b84 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -28,6 +28,7 @@ import { ActorModel } from '../../models/activitypub/actor' | |||
28 | import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor' | 28 | import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor' |
29 | import { isVideoChannelNameValid } from '../../helpers/custom-validators/video-channels' | 29 | import { isVideoChannelNameValid } from '../../helpers/custom-validators/video-channels' |
30 | import { UserRegister } from '../../../shared/models/users/user-register.model' | 30 | import { UserRegister } from '../../../shared/models/users/user-register.model' |
31 | import { isThemeValid } from '../../helpers/custom-validators/plugins' | ||
31 | 32 | ||
32 | const usersAddValidator = [ | 33 | const usersAddValidator = [ |
33 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), | 34 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), |
@@ -204,6 +205,9 @@ const usersUpdateMeValidator = [ | |||
204 | body('videosHistoryEnabled') | 205 | body('videosHistoryEnabled') |
205 | .optional() | 206 | .optional() |
206 | .custom(isUserVideosHistoryEnabledValid).withMessage('Should have a valid videos history enabled attribute'), | 207 | .custom(isUserVideosHistoryEnabledValid).withMessage('Should have a valid videos history enabled attribute'), |
208 | body('theme') | ||
209 | .optional() | ||
210 | .custom(isThemeValid).withMessage('Should have a valid theme'), | ||
207 | 211 | ||
208 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 212 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
209 | logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') }) | 213 | logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') }) |