]> 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 5f44c3b999874f1b5c58e58bbf76c0a769ba53f8..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'),
@@ -210,7 +212,7 @@ const usersResetPasswordValidator = [
       return res
         .status(403)
         .send({ error: 'Invalid verification string.' })
-        .end
+        .end()
     }
 
     return next()
@@ -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
   }