mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
dont allow empty userslugs to register
This commit is contained in:
@@ -61,7 +61,7 @@ define(function() {
|
|||||||
showError(username_notify, 'Username too short!');
|
showError(username_notify, 'Username too short!');
|
||||||
} else if (username.val().length > config.maximumUsernameLength) {
|
} else if (username.val().length > config.maximumUsernameLength) {
|
||||||
showError(username_notify, 'Username too long!');
|
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!');
|
showError(username_notify, 'Invalid username!');
|
||||||
} else {
|
} else {
|
||||||
socket.emit('user.exists', {
|
socket.emit('user.exists', {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var utils = require('./../public/src/utils.js'),
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
next(!utils.isUserNameValid(username) ? new Error('Invalid Username!') : null);
|
next((!utils.isUserNameValid(username) || !userslug) ? new Error('Invalid Username!') : null);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
if (password !== undefined) {
|
if (password !== undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user