aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-29 11:03:01 +0200
committerChocobozzz <me@florianbigard.com>2019-05-29 11:19:54 +0200
commit1d5342abc43df02cf0bd69b1e865c0f179182eef (patch)
treef008b43ca8189ee5856e39e5b9d4800bf37f9575 /server/middlewares/validators
parente590b4a512617bbf63595b684386f68abea7d8b8 (diff)
downloadPeerTube-1d5342abc43df02cf0bd69b1e865c0f179182eef.tar.gz
PeerTube-1d5342abc43df02cf0bd69b1e865c0f179182eef.tar.zst
PeerTube-1d5342abc43df02cf0bd69b1e865c0f179182eef.zip
Multi step registration
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/users.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index b58dcc0d6..7a081af33 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -70,6 +70,12 @@ const usersRegisterValidator = [
70 .end() 70 .end()
71 } 71 }
72 72
73 if (body.channel.name === body.username) {
74 return res.status(400)
75 .send({ error: 'Channel name cannot be the same than user username.' })
76 .end()
77 }
78
73 const existing = await ActorModel.loadLocalByName(body.channel.name) 79 const existing = await ActorModel.loadLocalByName(body.channel.name)
74 if (existing) { 80 if (existing) {
75 return res.status(409) 81 return res.status(409)