From 563d032e97cc62de50281e6413a8a03ed37a3d3b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 4 Nov 2017 18:32:38 +0100 Subject: Usernames are case insensitive now --- server/middlewares/validators/users.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/middlewares/validators/users.ts') diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 0b463acc0..6b845f62b 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts @@ -19,7 +19,7 @@ import { import { UserInstance, VideoInstance } from '../../models' const usersAddValidator = [ - body('username').custom(isUserUsernameValid).withMessage('Should have a valid username'), + body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), body('password').custom(isUserPasswordValid).withMessage('Should have a valid password'), body('email').isEmail().withMessage('Should have a valid email'), body('videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'), @@ -196,7 +196,7 @@ function checkUserDoesNotAlreadyExist (username: string, email: string, res: exp .then(user => { if (user) { return res.status(409) - .send({ error: 'User already exists.' }) + .send({ error: 'User with this username of email already exists.' }) .end() } -- cgit v1.2.3