diff --git a/controllers/user.js b/controllers/user.js index 8b28fa3189f..07a0523d5fa 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -103,14 +103,14 @@ exports.postEmailSignup = function(req, res, next) { var possibleUserData = req.body; - if (possibleUserData.password.length < 5) { + if (possibleUserData.password.length < 8) { req.flash('errors', { msg: 'Your password is too short' }); return res.redirect('email-signup'); } - if (possibleUserData.username.length < 8 || possibleUserData.length > 20) { + if (possibleUserData.username.length < 5 || possibleUserData.length > 20) { req.flash('errors', { msg: 'Your username must be between 5 and 20 characters' }); diff --git a/views/account/email-signup.jade b/views/account/email-signup.jade index 1764c86f107..9c4fe0e3377 100644 --- a/views/account/email-signup.jade +++ b/views/account/email-signup.jade @@ -21,7 +21,7 @@ block content | That email address is already in use. .form-group .col-sm-6.col-sm-offset-3 - input.form-control(type='text', name='username', ng-keypress='', autocomplete="off", id='username', placeholder='username', ng-model='username', unique-username='', required, ng-minlength=8, ng-maxlength=20, ng-pattern="/^[A-z0-9_]+$/") + input.form-control(type='text', name='username', ng-keypress='', autocomplete="off", id='username', placeholder='username', ng-model='username', unique-username='', required, ng-minlength=5, ng-maxlength=20, ng-pattern="/^[A-z0-9_]+$/") .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="profileForm.username.$error.pattern && !signupForm.username.$pristine") alert(type='danger') span.ion-close-circled @@ -40,7 +40,7 @@ block content | Your usernames must be 20 characters or fewer. .form-group .col-sm-6.col-sm-offset-3 - input.form-control(type='password', ng-model='password', name='password', id='password', placeholder='password', required, ng-minlength=5) + input.form-control(type='password', ng-model='password', name='password', id='password', placeholder='password', required, ng-minlength=8) .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="signupForm.password.$error.minlength && !signupForm.password.$pristine") alert(type='danger') span.ion-close-circled