@@ -75,7 +75,7 @@ module.exports = function (RED) {
75
75
try {
76
76
77
77
if ( config . thing !== "" && config . property !== "" ) {
78
- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
78
+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
79
79
if ( this . arduinoRestClient ) {
80
80
this . arduinoRestClient . openConnections ++ ;
81
81
this . organization = config . organization ;
@@ -152,7 +152,7 @@ module.exports = function (RED) {
152
152
this . timeWindowUnit = config . timeWindowUnit ;
153
153
if ( connectionConfig && config . thing !== "" && config . thing !== "0" && config . property !== "" && config . property !== "0" ) {
154
154
try {
155
- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
155
+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
156
156
if ( this . arduinoRestClient ) {
157
157
this . arduinoRestClient . openConnections ++ ;
158
158
if ( config . thing !== "" && config . property !== "" ) {
@@ -251,7 +251,7 @@ module.exports = function (RED) {
251
251
this . organization = config . organization ;
252
252
if ( connectionConfig && config . thing !== "" && config . thing !== "0" && config . property !== "" && config . property !== "0" ) {
253
253
try {
254
- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
254
+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
255
255
if ( this . arduinoRestClient ) {
256
256
this . arduinoRestClient . openConnections ++ ;
257
257
if ( config . thing !== "" && config . property !== "" ) {
@@ -340,7 +340,7 @@ module.exports = function (RED) {
340
340
try {
341
341
342
342
if ( config . thing !== "" && config . property !== "" ) {
343
- this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
343
+ this . arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
344
344
if ( this . arduinoRestClient ) {
345
345
this . arduinoRestClient . openConnections ++ ;
346
346
this . organization = config . organization ;
@@ -432,15 +432,15 @@ module.exports = function (RED) {
432
432
clientid : req . query . clientid ,
433
433
clientsecret : req . query . clientsecret
434
434
}
435
- } ) ;
435
+ } , this . organization ) ;
436
436
} else if ( req . query . connectionid ) {
437
437
const connectionConfig = RED . nodes . getNode ( req . query . connectionid ) ;
438
438
if ( ! connectionConfig ) {
439
439
str = RED . _ ( "arduino-iot-cloud.connection-error.no-cred-available" ) ;
440
440
console . log ( str ) ;
441
441
return res . send ( JSON . stringify ( { error : str } ) ) ;
442
442
}
443
- arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
443
+ arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig , this . organization ) ;
444
444
} else {
445
445
str = RED . _ ( "arduino-iot-cloud.connection-error.no-cred-available" ) ;
446
446
console . log ( str ) ;
0 commit comments