From 20e66cbd40114d86232efec38dad7bd1390ca972 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Wed, 25 Apr 2018 12:55:03 +0200 Subject: [PATCH] Token auth in researchSync and UPSdisplay --- sharedPlugins/UPSdisplay/index.js | 2 +- sharedPlugins/researchSync/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sharedPlugins/UPSdisplay/index.js b/sharedPlugins/UPSdisplay/index.js index a226b38a..5618783e 100644 --- a/sharedPlugins/UPSdisplay/index.js +++ b/sharedPlugins/UPSdisplay/index.js @@ -17,7 +17,7 @@ class UPSdisplay { let UPS = Math.round(ticksInPeriod / (timePeriod/1000)); // console.log("UPS: " + UPS); try{ - needle.post(this.config.masterIP+':'+this.config.masterPort+'/api/editSlaveMeta', {instanceID: this.config.unique, password: this.config.clientPassword, meta: {UPS:UPS}}, function(err, resp) { + needle.post(this.config.masterIP+':'+this.config.masterPort+'/api/editSlaveMeta', {instanceID: this.config.unique, password: this.config.clientPassword, meta: {UPS:UPS}}, {headers: {'x-access-token': this.config.masterAuthToken}}, function(err, resp) { // success? }); } catch (err){ diff --git a/sharedPlugins/researchSync/index.js b/sharedPlugins/researchSync/index.js index bdae8729..e198e310 100644 --- a/sharedPlugins/researchSync/index.js +++ b/sharedPlugins/researchSync/index.js @@ -83,7 +83,7 @@ class ResearchSync { instanceID: this.config.unique, password: this.config.clientPassword, meta: {research: this.research} - }, function (err, resp) { + }, {headers: {'x-access-token': this.config.masterAuthToken}}, function (err, resp) { // success? }); });