diff options
Diffstat (limited to 'server/middlewares/validators/config.ts')
-rw-r--r-- | server/middlewares/validators/config.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index 31b131914..9c43da165 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts | |||
@@ -5,7 +5,8 @@ import { logger } from '../../helpers/logger' | |||
5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | 5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' |
6 | import { Emailer } from '../../lib/emailer' | 6 | import { Emailer } from '../../lib/emailer' |
7 | import { areValidationErrors } from './utils' | 7 | import { areValidationErrors } from './utils' |
8 | import { isThemeValid } from '../../helpers/custom-validators/plugins' | 8 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' |
9 | import { isThemeRegistered } from '../../lib/plugins/theme-utils' | ||
9 | 10 | ||
10 | const customConfigUpdateValidator = [ | 11 | const customConfigUpdateValidator = [ |
11 | body('instance.name').exists().withMessage('Should have a valid instance name'), | 12 | body('instance.name').exists().withMessage('Should have a valid instance name'), |
@@ -48,7 +49,7 @@ const customConfigUpdateValidator = [ | |||
48 | body('followers.instance.enabled').isBoolean().withMessage('Should have a valid followers of instance boolean'), | 49 | body('followers.instance.enabled').isBoolean().withMessage('Should have a valid followers of instance boolean'), |
49 | body('followers.instance.manualApproval').isBoolean().withMessage('Should have a valid manual approval boolean'), | 50 | body('followers.instance.manualApproval').isBoolean().withMessage('Should have a valid manual approval boolean'), |
50 | 51 | ||
51 | body('theme.default').custom(isThemeValid).withMessage('Should have a valid theme'), | 52 | body('theme.default').custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'), |
52 | 53 | ||
53 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 54 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
54 | logger.debug('Checking customConfigUpdateValidator parameters', { parameters: req.body }) | 55 | logger.debug('Checking customConfigUpdateValidator parameters', { parameters: req.body }) |