Tweak the credential handling

- use node.credentials rather than node._creds for consistency with the runtime
 - simplify the structure of node.credentials
This commit is contained in:
Nick O'Leary
2014-07-19 00:16:21 +01:00
parent 760dd022dc
commit b604db83f6
4 changed files with 91 additions and 76 deletions

View File

@@ -45,12 +45,11 @@ var parseCredentials = function (config) {
for (var i in config) {
if (config.hasOwnProperty(i)) {
var node = config[i];
if (!node._creds) {
continue;
if (node.credentials) {
var type = node.type;
credentials.merge(node.id, type, node.credentials);
delete node.credentials;
}
var type = node.type;
credentials.merge(node.id, type, node._creds);
delete node._creds;
}
}
credentials.save().then(function () {