Skip to content

Commit

Permalink
dont allow empty userslugs to register
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Nov 7, 2013
1 parent d7856bc commit 4552e62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/src/forum/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ define(function() {
showError(username_notify, 'Username too short!');
} else if (username.val().length > config.maximumUsernameLength) {
showError(username_notify, 'Username too long!');
} else if (!utils.isUserNameValid(username.val())) {
} else if (!utils.isUserNameValid(username.val()) || !utils.slugify(username.val())) {
showError(username_notify, 'Invalid username!');
} else {
socket.emit('user.exists', {
Expand Down
2 changes: 1 addition & 1 deletion src/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var utils = require('./../public/src/utils.js'),
}
},
function(next) {
next(!utils.isUserNameValid(username) ? new Error('Invalid Username!') : null);
next((!utils.isUserNameValid(username) || !userslug) ? new Error('Invalid Username!') : null);
},
function(next) {
if (password !== undefined) {
Expand Down

0 comments on commit 4552e62

Please sign in to comment.