From 1d5342abc43df02cf0bd69b1e865c0f179182eef Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 May 2019 11:03:01 +0200 Subject: Multi step registration --- server/middlewares/validators/users.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/middlewares') 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 = [ .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) -- cgit v1.2.3