@@ -75,7 +75,7 @@ module.exports = function (RED) {
7575 try {
7676
7777 if ( config . thing !== "" && config . property !== "" ) {
78- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
78+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
7979 if ( this . arduinoRestClient ) {
8080 this . arduinoRestClient . openConnections ++ ;
8181 this . organization = config . organization ;
@@ -152,7 +152,7 @@ module.exports = function (RED) {
152152 this . timeWindowUnit = config . timeWindowUnit ;
153153 if ( connectionConfig && config . thing !== "" && config . thing !== "0" && config . property !== "" && config . property !== "0" ) {
154154 try {
155- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
155+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
156156 if ( this . arduinoRestClient ) {
157157 this . arduinoRestClient . openConnections ++ ;
158158 if ( config . thing !== "" && config . property !== "" ) {
@@ -251,7 +251,7 @@ module.exports = function (RED) {
251251 this . organization = config . organization ;
252252 if ( connectionConfig && config . thing !== "" && config . thing !== "0" && config . property !== "" && config . property !== "0" ) {
253253 try {
254- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
254+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
255255 if ( this . arduinoRestClient ) {
256256 this . arduinoRestClient . openConnections ++ ;
257257 if ( config . thing !== "" && config . property !== "" ) {
@@ -340,7 +340,7 @@ module.exports = function (RED) {
340340 try {
341341
342342 if ( config . thing !== "" && config . property !== "" ) {
343- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
343+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
344344 if ( this . arduinoRestClient ) {
345345 this . arduinoRestClient . openConnections ++ ;
346346 this . organization = config . organization ;
@@ -432,15 +432,15 @@ module.exports = function (RED) {
432432 clientid : req . query . clientid ,
433433 clientsecret : req . query . clientsecret
434434 }
435- } ) ;
435+ } , this . organization ) ;
436436 } else if ( req . query . connectionid ) {
437437 const connectionConfig = RED . nodes . getNode ( req . query . connectionid ) ;
438438 if ( ! connectionConfig ) {
439439 str = RED . _ ( "arduino-iot-cloud.connection-error.no-cred-available" ) ;
440440 console . log ( str ) ;
441441 return res . send ( JSON . stringify ( { error : str } ) ) ;
442442 }
443- arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
443+ arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
444444 } else {
445445 str = RED . _ ( "arduino-iot-cloud.connection-error.no-cred-available" ) ;
446446 console . log ( str ) ;
0 commit comments