diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-04 18:32:38 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-04 18:32:38 +0100 |
commit | 563d032e97cc62de50281e6413a8a03ed37a3d3b (patch) | |
tree | 43f09cc746f8b3b92d9d7b078ae93d2af7c3b032 /server/middlewares/validators/users.ts | |
parent | f73544839586d5e50529617f3649a84ac9e0ab86 (diff) | |
download | PeerTube-563d032e97cc62de50281e6413a8a03ed37a3d3b.tar.gz PeerTube-563d032e97cc62de50281e6413a8a03ed37a3d3b.tar.zst PeerTube-563d032e97cc62de50281e6413a8a03ed37a3d3b.zip |
Usernames are case insensitive now
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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 { | |||
19 | import { UserInstance, VideoInstance } from '../../models' | 19 | import { UserInstance, VideoInstance } from '../../models' |
20 | 20 | ||
21 | const usersAddValidator = [ | 21 | const usersAddValidator = [ |
22 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username'), | 22 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), |
23 | body('password').custom(isUserPasswordValid).withMessage('Should have a valid password'), | 23 | body('password').custom(isUserPasswordValid).withMessage('Should have a valid password'), |
24 | body('email').isEmail().withMessage('Should have a valid email'), | 24 | body('email').isEmail().withMessage('Should have a valid email'), |
25 | body('videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'), | 25 | body('videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'), |
@@ -196,7 +196,7 @@ function checkUserDoesNotAlreadyExist (username: string, email: string, res: exp | |||
196 | .then(user => { | 196 | .then(user => { |
197 | if (user) { | 197 | if (user) { |
198 | return res.status(409) | 198 | return res.status(409) |
199 | .send({ error: 'User already exists.' }) | 199 | .send({ error: 'User with this username of email already exists.' }) |
200 | .end() | 200 | .end() |
201 | } | 201 | } |
202 | 202 | ||