From f37ec60951a021f1bd50e03f90b4eeadcd6905bb Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Wed, 1 Apr 2015 21:34:36 -0300 Subject: [PATCH] fix unauthorized --- lib/wsapp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/wsapp.js b/lib/wsapp.js index d307be2..2a56a38 100644 --- a/lib/wsapp.js +++ b/lib/wsapp.js @@ -20,7 +20,7 @@ var io, bcMonitor; var WsApp = function() {}; -WsApp._unauthorized = function() { +WsApp._unauthorized = function(socket) { socket.emit('unauthorized'); socket.disconnect(); }; @@ -52,10 +52,10 @@ WsApp.start = function(server) { socket.emit('challenge', socket.nonce); socket.on('authorize', function(data) { - if (data.message != socket.nonce) return WsApp.unauthorized(); + if (data.message != socket.nonce) return WsApp._unauthorized(socket); WalletService.getInstanceWithAuth(data, function(err, service) { - if (err) return WsApp.unauthorized(); + if (err) return WsApp._unauthorized(socket); socket.join(service.walletId); socket.emit('authorized');