Sails: io.socket.get requests are throwing 401 Unauthorized

45 Views Asked by At

I recently upgraded the version of Sails from version 1.5.2 to 1.5.7 for Vulnerability Fix. This is my first time working with sails and node. So, there are lots of gaps in my understanding.

After the version upgrade, the io.socket.get requests have started failing. I'm not sure why this is happening. Example Request: io.socket.get("/api/v1/direc/get-token", {}, gotToken)
PS: The routes are setup properly.

To verify, I switched the Sails version to 1.5.6 and it works. But, I need to be on v1.5.7.

Can anyone please tell me what is happening? I'm open to knowledge of all kinds.

These are my dependencies:

  "dependencies": {
    "sails": "1.5.7",
    "sails-hook-apianalytics": "2.0.5",
    "sails-hook-organics": "2.2.0",
    "sails-hook-orm": "4.0.1",
    "sails-hook-pino": "1.1.2",
    "sails-hook-sockets": "2.0.4",
    "@sailshq/lodash": "3.10.4",
    "sails-postgresql": "4.0.0",
    "passport": "0.6.0",
    "@techpass/passport-openidconnect": "0.3.2",
    "connect-pg-simple": "7.0.0",
    "crypto": "1.0.1",
    "morgan": "1.10.0",
    "on-headers": "1.0.2",
    "twilio": "3.43.0",
    "@sentry/node": "7.0.0"
  }

Node Version: v18.17.1

  1. I've left log messages at the requested URL, expecting to see the messages in the log. The messages never got printed, but the callback function was triggered either way.
  2. I upgraded sails-hook-sockets to the latest version hoping to see the issue fixed.
0

There are 0 best solutions below