]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/users.js
Server: forbid to remove the root user
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / users.js
index d541e91247c0c1125761dff8f2b951836d90d501..02e4f34cba4fd2072a14452397d044e320917b16 100644 (file)
@@ -47,6 +47,8 @@ function usersRemove (req, res, next) {
 
       if (!user) return res.status(404).send('User not found')
 
+      if (user.username === 'root') return res.status(400).send('Cannot remove the root user')
+
       next()
     })
   })