http: allow admin status for noAuth.
This commit is contained in:
parent
383c8f085f
commit
745c12ef3a
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user