Skip to content

Commit

Permalink
Fix credentials error
Browse files Browse the repository at this point in the history
  • Loading branch information
Klervix committed Jul 24, 2019
1 parent 4075b7b commit e47f45a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions node-red-contrib-ms-vision/node-vision-image-describe.js
Expand Up @@ -11,9 +11,13 @@ module.exports = function(RED) {
let node = this; let node = this;


node.status({fill:"red", shape:"ring", text: 'Missing credential'}); node.status({fill:"red", shape:"ring", text: 'Missing credential'});
this.visioncreds = RED.nodes.getCredentials(config.visionkey); try {

this.visioncreds = RED.nodes.getNode(config.visionkey).credentials;
if (this.visioncreds) node.status({}); if (this.visioncreds) node.status({});
}
catch(err) {
this.visioncreds = {};
}


this.on('input', (data) => { input(RED, node, data, config) }); this.on('input', (data) => { input(RED, node, data, config) });
} }
Expand Down
9 changes: 7 additions & 2 deletions node-red-contrib-ms-vision/node-vision-image-faces.js
Expand Up @@ -11,8 +11,13 @@ module.exports = function(RED) {
let node = this; let node = this;


node.status({fill:"red", shape:"ring", text: 'Missing credential'}); node.status({fill:"red", shape:"ring", text: 'Missing credential'});
this.facecreds = RED.nodes.getCredentials(config.facekey); try {
if (this.facecreds) node.status({}); this.facecreds = RED.nodes.getNode(config.facekey).credentials;
if (this.facecreds) node.status({});
}
catch(err) {
this.facecreds = {};
}


this.on('input', (data) => { input(node, data, config) }); this.on('input', (data) => { input(node, data, config) });
} }
Expand Down
2 changes: 1 addition & 1 deletion node-red-contrib-ms-vision/package.json
@@ -1,6 +1,6 @@
{ {
"name" : "node-red-contrib-viseo-ms-vision", "name" : "node-red-contrib-viseo-ms-vision",
"version" : "0.1.0", "version" : "0.1.1",
"description" : "VISEO Bot Maker - Microsoft Cognitive Services Vision", "description" : "VISEO Bot Maker - Microsoft Cognitive Services Vision",
"dependencies" : { "dependencies" : {
"node-red-contrib-viseo-ms-authentication" : "~0.0.0", "node-red-contrib-viseo-ms-authentication" : "~0.0.0",
Expand Down

0 comments on commit e47f45a

Please sign in to comment.