All files / lib socket.js

30% Statements 3/10
100% Branches 0/0
0% Functions 0/4
30% Lines 3/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161x 1x   1x                        
const debug = require('debug')('@feathersjs/authentication:sockets');
const { NotImplemented } = require('@feathersjs/errors');
 
module.exports = function legacySocketHandler () {
  return socket => {
    socket.on('authenticate', (data, callback) => {
      debug('Got legacy authenticate socket event, sending back error');
      callback(new NotImplemented('Invalid socket authentication mechanism. Please upgrade to the latest client.'));
    });
    socket.on('logout', callback => {
      debug('Got legacy logout socket event, sending back error');
      callback(new NotImplemented('Invalid logout mechanism. Please upgrade to the latest client.'));
    });
  };
};