make Prowl consistent with Pushbullet

This commit is contained in:
Dave C-J
2014-04-27 16:39:09 +01:00
parent 2c80c90f84
commit 3a4f870257
2 changed files with 10 additions and 1 deletions

View File

@@ -75,7 +75,13 @@ RED.httpAdmin.get('/prowl/:id',function(req,res) {
var credentials = RED.nodes.getCredentials(req.params.id);
if (credentials) {
res.send(JSON.stringify({hasPassword:(credentials.pushkey&&credentials.pushkey!="")}));
} else {
}
else if (pushkeys && pushkeys.prowlkey) {
RED.nodes.addCredentials(req.params.id,{pushkey:pushkeys.prowlkey,global:true});
credentials = RED.nodes.getCredentials(req.params.id);
res.send(JSON.stringify({hasPassword:(credentials.pushkey&&credentials.pushkey!=""),global:credentials.global}));;
}
else {
res.send(JSON.stringify({}));
}
});