Skip to content

Commit 61841af

Browse files
authored
Real-time flows with authentication errors (#74)
1 parent 3f60e31 commit 61841af

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.7.3 (November 09, 2023)
2+
* Fixed [issue](https://github.com/elasticio/salesforce-component-v2/issues/72) when real-time flows have authentication errors sometimes
3+
14
## 2.7.2 (September 28, 2023)
25
* Improvements in `Subscribe to platform events` trigger:
36
* fixed duplicates retries on connections lost

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Customer relationship management (CRM) software & cloud computing from the leader in CRM solutions for businesses large & small.",
44
"docsUrl": "https://github.com/elasticio/salesforce-component-v2",
55
"url": "http://www.salesforce.com/",
6-
"version": "2.7.2",
6+
"version": "2.7.3",
77
"authClientTypes": [
88
"oauth2"
99
],

lib/helpers/wrapper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,14 @@ exports.callJSForceMethod = async function callJSForceMethod(configuration, meth
5959
const newSecret = await getSecret(this, secretId);
6060
if (newSecret.credentials.access_token !== accessToken) {
6161
this.logger.debug('token changed, trying to use new one');
62-
accessToken = newSecret.credentials.access_token;
62+
secret = newSecret;
63+
accessToken = secret.credentials.access_token;
64+
instanceUrl = secret.credentials.undefined_params.instance_url;
6365
} else {
6466
await refreshToken(this, secretId);
6567
secret = await getSecret(this, secretId);
6668
accessToken = secret.credentials.access_token;
69+
instanceUrl = secret.credentials.undefined_params.instance_url;
6770
this.logger.debug('Token is successfully refreshed');
6871
}
6972
client = undefined;

0 commit comments

Comments
 (0)