fix: add logging for URL and token in WebSocket client verification

This commit is contained in:
Giuseppe Raffa
2026-04-14 15:47:40 +02:00
parent 73675ddfff
commit 82310a521f

View File

@@ -13,8 +13,10 @@ module.exports = function setupSensorWebSocket(server) {
path: wsPath,
perMessageDeflate: false,
verifyClient: async (info, callback) => {
console.log('[WS|verifyClient] URL:', info.req.url);
const { query } = url.parse(info.req.url, true);
const token = query.token;
console.log('[WS|verifyClient] Token ricevuto:', token);
if (!token) {
return callback(false, 401, 'token not passed');