dont call isAdmin if not logged in

v1.18.x
barisusakli 10 years ago
parent 209edf182f
commit 7bfc36ff56

@ -36,6 +36,9 @@ var async = require('async'),
}; };
SocketAdmin.before = function(socket, method, next) { SocketAdmin.before = function(socket, method, next) {
if (!socket.uid) {
return;
}
user.isAdministrator(socket.uid, function(err, isAdmin) { user.isAdministrator(socket.uid, function(err, isAdmin) {
if (!err && isAdmin) { if (!err && isAdmin) {
next(); next();

Loading…
Cancel
Save