mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Update all nodes to credentials system and auth middleware
This commit is contained in:
@@ -55,6 +55,10 @@
|
||||
name: {value:""},
|
||||
priority: {value:0}
|
||||
},
|
||||
credentials: {
|
||||
deviceid: {type:"text"},
|
||||
pushkey: {type: "password"}
|
||||
},
|
||||
color:"#a7c9a0",
|
||||
inputs:1,
|
||||
outputs:0,
|
||||
@@ -71,39 +75,6 @@
|
||||
min:-1,
|
||||
max:2
|
||||
});
|
||||
$.getJSON('pushover/'+this.id,function(data) {
|
||||
if (data.deviceid) {
|
||||
$('#node-config-input-deviceid').val(data.deviceid);
|
||||
}
|
||||
if (data.hasPassword) {
|
||||
$('#node-config-input-pushkey').val('__PWRD__');
|
||||
} else {
|
||||
$('#node-config-input-pushkey').val('');
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
oneditsave: function() {
|
||||
var credentials = {};
|
||||
var newUser = $('#node-config-input-deviceid').val();
|
||||
var newPass = $('#node-config-input-pushkey').val();
|
||||
credentials.deviceid = newUser;
|
||||
if (newPass != '__PWRD__') {
|
||||
credentials.pushkey = newPass;
|
||||
}
|
||||
$.ajax({
|
||||
url: 'pushover/'+this.id,
|
||||
type: 'POST',
|
||||
data: credentials,
|
||||
success: function(result){}
|
||||
});
|
||||
},
|
||||
ondelete: function() {
|
||||
$.ajax({
|
||||
url: 'pushover/'+this.id,
|
||||
type: 'DELETE',
|
||||
success: function(result) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user