Skip to content

Commit

Permalink
fix: the refreshFn cannot be set when refresh delegates is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeneos committed Jan 25, 2023
1 parent 7bd75e5 commit 9d5222a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/salesforce/src/connection/salesforceConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export class SalesforceConnection extends Connection {
this.tooling['_logger'] = new JsForceLogAdapter(this.logger);

// Overwrite refresh function on refresh delegate
this['_refreshDelegate']['_refreshFn'] = SalesforceConnection.refreshAccessToken;
if (this['_refreshDelegate']) {
this['_refreshDelegate']['_refreshFn'] = SalesforceConnection.refreshAccessToken;
}
}

private static refreshAccessToken(_this: SalesforceConnection, callback: (err: any, accessToken?: string, response?: any) => void) : Promise<string> {
Expand Down

0 comments on commit 9d5222a

Please sign in to comment.