From d69054804e35155c163fc15134b083ce0cccda35 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 11 Nov 2014 11:37:32 -0500 Subject: [PATCH] closes #2391 --- src/routes/authentication.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 979e08c1bc..c485586fa3 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -118,6 +118,12 @@ return res.redirect(nconf.get('relative_path') + '/register' + (err.message ? '?error=' + err.message : '')); } + if (userData.username.length < meta.config.minimumUsernameLength) { + return res.redirect(nconf.get('relative_path') + '/register?error=[[error:username-too-short]]'); + } else if (userData.username.length > meta.config.maximumUsernameLength) { + return res.redirect(nconf.get('relative_path') + '/register?error=[[error:username-too-long]]'); + } + user.create(userData, function(err, uid) { if (err || !uid) { return res.redirect(nconf.get('relative_path') + '/register');