1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Improved MeshCtrl.js error message.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-27 01:17:03 -07:00
parent 4014973228
commit d8bebb719e
2 changed files with 13 additions and 9 deletions

View file

@ -569,7 +569,7 @@ function serverConnect() {
var keydata = fs.readFileSync(args.loginkeyfile, 'utf8').split(' ').join('').split('\r').join('').split('\n').join('');
ckey = Buffer.from(keydata, 'hex');
if (ckey.length != 80) { console.log("Invalid login key file."); process.exit(); return; }
} catch (ex) { console.log(ex); process.exit(); return; }
} catch (ex) { console.log(ex.message); process.exit(); return; }
}
if (ckey != null) {
@ -961,7 +961,11 @@ function serverConnect() {
if (data.msg == 'tokenrequired') {
console.log('Authentication token required, use --token [number].');
} else {
console.log('Invalid login.');
if ((args.loginkeyfile != null) || (args.loginkey != null)) {
console.log('Invalid login, check the login key and that this computer has the correct time.');
} else {
console.log('Invalid login.');
}
}
}
process.exit();