Fixed loginkey issue in meshctrl.js, #3956

Ylian Saint-Hilaire committed May 10, 2022 at 19:55 UTC d5cf9dba3376a1c7374847e736118977336b3861
1 file changed +2 -2
meshctrl.js
+2 -2
@@ -1126,10 +1126,10 @@ function serverConnect() {
1126 // Cookie authentication
1127 var ckey = null, loginCookie = null;
1128 if (args.loginkey != null) {
1129 - // User key passed in a argument hex
1129 + // User key passed in as argument hex
1130 if (args.loginkey.length != 160) { loginCookie = args.loginkey; }
1131 ckey = Buffer.from(args.loginkey, 'hex');
1132 - if (ckey != 80) { ckey = null; loginCookie = args.loginkey; }
1132 + if (ckey.length != 80) { ckey = null; loginCookie = args.loginkey; }
1133 } else if (args.loginkeyfile != null) {
1134 // Load key from hex file
1135 var fs = require('fs');