]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/users.ts
Add redis cache to feed route
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / users.ts
index cba15c8d3c33e11fe1a7c28be15cdfaf9ae2fa1a..6ea3d0b6c6b0bd64212d51bdfbc5ba851ad6a381 100644 (file)
@@ -7,6 +7,7 @@ import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
 import {
   isAvatarFile,
   isUserAutoPlayVideoValid,
+  isUserDescriptionValid,
   isUserDisplayNSFWValid,
   isUserPasswordValid,
   isUserRoleValid,
@@ -97,6 +98,7 @@ const usersUpdateValidator = [
 ]
 
 const usersUpdateMeValidator = [
+  body('description').optional().custom(isUserDescriptionValid).withMessage('Should have a valid description'),
   body('password').optional().custom(isUserPasswordValid).withMessage('Should have a valid password'),
   body('email').optional().isEmail().withMessage('Should have a valid email attribute'),
   body('displayNSFW').optional().custom(isUserDisplayNSFWValid).withMessage('Should have a valid display Not Safe For Work attribute'),
@@ -248,7 +250,7 @@ async function checkUserNameOrEmailDoesNotAlreadyExist (username: string, email:
 
   if (user) {
     res.status(409)
-              .send({ error: 'User with this username of email already exists.' })
+              .send({ error: 'User with this username or email already exists.' })
               .end()
     return false
   }