Browse Source

fix unauthorized

activeAddress
Ivan Socolsky 10 years ago
parent
commit
f37ec60951
  1. 6
      lib/wsapp.js

6
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');

Loading…
Cancel
Save