diff --git a/lib/http/server.js b/lib/http/server.js index 68b3c64a..d26e3243 100644 --- a/lib/http/server.js +++ b/lib/http/server.js @@ -164,8 +164,10 @@ HTTPServer.prototype._init = function _init() { this.use(function(req, res, send, next) { var hash; - if (!this.apiHash) + if (!this.apiHash) { + req.admin = true; return next(); + } hash = hash256(req.password); @@ -1105,6 +1107,8 @@ HTTPServer.prototype._initIO = function _initIO() { if (!crypto.ccmp(hash, self.apiHash)) return callback({ error: 'Bad key.' }); } + } else { + socket.admin = true; } socket.auth = true;