diff options
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/users.ts | 6 |
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) |