X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Faccount.ts;h=a7534ced523441c8b4d1bd11c840cb6b70901da6;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=e529c831d541ea575e80209a8d6f3d623848dc00;hpb=97eba003a9d0adcb0cab9190f566327b1417c7d3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/account.ts b/server/middlewares/validators/account.ts index e529c831d..a7534ced5 100644 --- a/server/middlewares/validators/account.ts +++ b/server/middlewares/validators/account.ts @@ -5,7 +5,8 @@ import { logger } from '../../helpers/logger' import { areValidationErrors, doesAccountNameWithHostExist, doesLocalAccountNameExist } from './shared' const localAccountValidator = [ - param('name').custom(isAccountNameValid).withMessage('Should have a valid account name'), + param('name') + .custom(isAccountNameValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking localAccountValidator parameters', { parameters: req.params }) @@ -18,7 +19,8 @@ const localAccountValidator = [ ] const accountNameWithHostGetValidator = [ - param('accountName').exists().withMessage('Should have an account name with host'), + param('accountName') + .exists(), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking accountsNameWithHostGetValidator parameters', { parameters: req.params })