From b7231e00e49436318a43196c9c3230ef2bac50bd Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 18 May 2022 13:13:09 -0700 Subject: [PATCH] Fixed MeshCtrl.js, #3999 --- meshctrl.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/meshctrl.js b/meshctrl.js index 059c85a3..cbc900fd 100644 --- a/meshctrl.js +++ b/meshctrl.js @@ -2187,8 +2187,18 @@ function serverConnect() { console.log(data.result); process.exit(); } 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; } case 'loginTokens': {