mirror of https://github.com/calzoneman/sync.git
Fix a few minor error conditions
This commit is contained in:
parent
ce44bfea9e
commit
1923af16a9
|
@ -2,7 +2,7 @@
|
|||
"author": "Calvin Montgomery",
|
||||
"name": "CyTube",
|
||||
"description": "Online media synchronizer and chat",
|
||||
"version": "3.58.2",
|
||||
"version": "3.58.3",
|
||||
"repository": {
|
||||
"url": "http://github.com/calzoneman/sync"
|
||||
},
|
||||
|
|
|
@ -338,7 +338,7 @@ Channel.prototype.checkModules = function (fn, args, cb) {
|
|||
};
|
||||
|
||||
args.push(next);
|
||||
next(null, ChannelModule.PASSTHROUGH);
|
||||
process.nextTick(next, null, ChannelModule.PASSTHROUGH);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ KickBanModule.prototype.handleCmdBan = function (user, msg, _meta) {
|
|||
this.banName(user, name, reason).catch(error => {
|
||||
const message = error.message || error;
|
||||
user.socket.emit("errorMsg", { msg: message });
|
||||
}).finally(() => {
|
||||
}).then(() => {
|
||||
chan.refCounter.unref("KickBanModule::handleCmdBan");
|
||||
});
|
||||
};
|
||||
|
@ -264,7 +264,7 @@ KickBanModule.prototype.handleCmdIPBan = function (user, msg, _meta) {
|
|||
//console.log('!!!', error.stack);
|
||||
const message = error.message || error;
|
||||
user.socket.emit("errorMsg", { msg: message });
|
||||
}).finally(() => {
|
||||
}).then(() => {
|
||||
chan.refCounter.unref("KickBanModule::handleCmdIPBan");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -228,6 +228,11 @@ module.exports = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!$util.isValidUserName(name)) {
|
||||
callback(`Invalid username "${name}"`);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Passwords are capped at 100 characters to prevent a potential
|
||||
denial of service vector through causing the server to hash
|
||||
ridiculously long strings.
|
||||
|
|
Loading…
Reference in New Issue