]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/users.ts
Multi step registration
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / users.ts
index b58dcc0d6adacc6b64c91b28c4ab529ea7f89761..7a081af33c266ceef1bec7551e9180997f14e912 100644 (file)
@@ -70,6 +70,12 @@ const usersRegisterValidator = [
           .end()
       }
 
+      if (body.channel.name === body.username) {
+        return res.status(400)
+                  .send({ error: 'Channel name cannot be the same than user username.' })
+                  .end()
+      }
+
       const existing = await ActorModel.loadLocalByName(body.channel.name)
       if (existing) {
         return res.status(409)