Improved MeshCtrl.js error message.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-27 01:17:03 -07:00
parent 5e9cbb8c42
commit f51cadef25
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();

View File

@ -162,45 +162,45 @@
"_authStrategies": {
"__comment__" : "This section is used to allow users to login using other accounts. You will need to get an API key from the services and register callback URL's",
"twitter": {
"__callbackurl": "https://server/auth-twitter-callback",
"_callbackurl": "https://server/auth-twitter-callback",
"newAccounts": true,
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"google": {
"__callbackurl": "https://server/auth-google-callback",
"_callbackurl": "https://server/auth-google-callback",
"newAccounts": true,
"clientid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxx"
},
"github": {
"__callbackurl": "https://server/auth-github-callback",
"_callbackurl": "https://server/auth-github-callback",
"newAccounts": true,
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"reddit": {
"__callbackurl": "https://server/auth-reddit-callback",
"_callbackurl": "https://server/auth-reddit-callback",
"newAccounts": true,
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"azure": {
"__callbackurl": "https://server/auth-azure-callback",
"_callbackurl": "https://server/auth-azure-callback",
"newAccounts": true,
"clientid": "00000000-0000-0000-0000-000000000000",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"tenantid": "00000000-0000-0000-0000-000000000000"
},
"jumpcloud": {
"__callbackurl": "https://server/auth-jumpcloud-callback",
"_callbackurl": "https://server/auth-jumpcloud-callback",
"newAccounts": true,
"entityid": "meshcentral",
"idpurl": "https://sso.jumpcloud.com/saml2/saml2",
"cert": "jumpcloud-saml.pem"
},
"saml": {
"__callbackurl": "https://server/auth-saml-callback",
"_callbackurl": "https://server/auth-saml-callback",
"newAccounts": true,
"entityid": "meshcentral",
"idpurl": "https://server/saml2",