Fixed MeshCtrl.js, #3999

This commit is contained in:
Ylian Saint-Hilaire 2022-05-18 13:13:09 -07:00
parent e9cff97905
commit b7231e00e4

View File

@ -2187,8 +2187,18 @@ function serverConnect() {
console.log(data.result); console.log(data.result);
process.exit(); process.exit();
} else { } else {
ws.send(JSON.stringify({ action: 'loginTokens', responseid: 'meshctrl' })); if (args.json) {
console.log(data);
} else {
console.log("New login token created.");
if (data.name) { console.log("Token name: " + data.name); }
if (data.created) { console.log("Created: " + new Date(data.created).toLocaleString()); }
if (data.expire) { console.log("Expire: " + new Date(data.expire).toLocaleString()); }
if (data.tokenUser) { console.log("Username: " + data.tokenUser); }
if (data.tokenPass) { console.log("Password: " + data.tokenPass); }
}
} }
process.exit();
break; break;
} }
case 'loginTokens': { case 'loginTokens': {