From d5cf9dba3376a1c7374847e736118977336b3861 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 10 May 2022 19:55:08 -0700 Subject: [PATCH] Fixed loginkey issue in meshctrl.js, #3956 --- meshctrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshctrl.js b/meshctrl.js index fb0e7cde..059c85a3 100644 --- a/meshctrl.js +++ b/meshctrl.js @@ -1126,10 +1126,10 @@ function serverConnect() { // Cookie authentication var ckey = null, loginCookie = null; if (args.loginkey != null) { - // User key passed in a argument hex + // User key passed in as argument hex if (args.loginkey.length != 160) { loginCookie = args.loginkey; } ckey = Buffer.from(args.loginkey, 'hex'); - if (ckey != 80) { ckey = null; loginCookie = args.loginkey; } + if (ckey.length != 80) { ckey = null; loginCookie = args.loginkey; } } else if (args.loginkeyfile != null) { // Load key from hex file var fs = require('fs');