Fixed loginkey issue in meshctrl.js, #3956

This commit is contained in:
Ylian Saint-Hilaire 2022-05-10 19:55:08 -07:00
parent 070a70650f
commit d5cf9dba33

View File

@ -1126,10 +1126,10 @@ function serverConnect() {
// Cookie authentication // Cookie authentication
var ckey = null, loginCookie = null; var ckey = null, loginCookie = null;
if (args.loginkey != 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; } if (args.loginkey.length != 160) { loginCookie = args.loginkey; }
ckey = Buffer.from(args.loginkey, 'hex'); 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) { } else if (args.loginkeyfile != null) {
// Load key from hex file // Load key from hex file
var fs = require('fs'); var fs = require('fs');