Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

use with feathersjs #57

@bzd2000

Description

@bzd2000

Hello,

I would like to use this plugin with feathersjs.
the connection with feathers works, but when using it with the @feathersjs/authentication-client plugin, I run into the following issue.

At some point it calls the following function:

const socketUpgradeHandler = () => {
      socket.io.engine.on('upgrade', () => {
        debug('Socket upgrading');

        // If socket was already authenticated then re-authenticate
        // it with the server automatically.
        if (socket.authenticated) {
          const data = {
            strategy: this.options.jwtStrategy,
            accessToken: app.get('accessToken')
          };

          this.authenticateSocket(data, socket, emit)
            .then(this.setJWT)
            .catch(error => {
              debug('Error re-authenticating after socket upgrade', error);
              socket.authenticated = false;
              app.emit('reauthentication-error', error);
            });
        }
      });
    };

But then it says "TypeError: Cannot read property 'engine' of undefined"
So I guess, the engine is not defined at socket.io.engine.on.

Any clue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions