Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Not specifying fail breaks Socket.io entirely #144

Open
kylecombes opened this issue Jun 12, 2019 · 2 comments
Open

Not specifying fail breaks Socket.io entirely #144

kylecombes opened this issue Jun 12, 2019 · 2 comments

Comments

@kylecombes
Copy link

kylecombes commented Jun 12, 2019

Using deps

  • Node v11.2.0
  • Socket.io v2.1.1
  • Passport v0.4.0

and not specifying success and fail, Socket.io breaks entirely without any error for me.

The solution for me was to simply copy and paste in the sample code from the README.

It seems as though accept(err, result) instead of accept() may be the correct approach for Socket.io >= v2, since that is what it ends up running with the code copied from the README and left unmodified. Just my guess though.

@kylecombes
Copy link
Author

Never mind, it doesn't fail anymore. This must've been related to another issue I was facing.

@kylecombes kylecombes reopened this Jun 14, 2019
@kylecombes kylecombes changed the title Not specifying success and fail breaks Socket.io entirely Not specifying fail breaks Socket.io entirely Jun 14, 2019
@kylecombes
Copy link
Author

OK, the issue came back. It seems that something in the default for fail is not working. Putting in the following for fail fixes it, and commenting it out breaks it again:

(data, message, error, accept) => {
      if (error) {
        throw new Error(message);
      } else {
        accept(null, false);
      }
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant