diff --git a/services/node-agent/index.js b/services/node-agent/index.js index 282c632..c4759bf 100644 --- a/services/node-agent/index.js +++ b/services/node-agent/index.js @@ -961,7 +961,12 @@ function checkAgentAuth(req) { const m = /^Bearer\s+(.+)$/i.exec(hdr); if (!m) return false; const token = m[1]; - return _bearerEq(token, NODE_TOKEN) || _bearerEq(token, CLUSTER_READ_TOKEN); + const okNode = _bearerEq(token, NODE_TOKEN); + const okShared = _bearerEq(token, CLUSTER_READ_TOKEN); + if (!okNode && !okShared) { + console.warn(`[auth] reject: tok.len=${token.length} NODE_TOKEN.len=${NODE_TOKEN.length} CLUSTER_READ_TOKEN.len=${CLUSTER_READ_TOKEN.length}`); + } + return okNode || okShared; } // ── Driver/SDK install ────────────────────────────────────────────────────