Skip to content

fix: Update connection.refreshToken if present in token response - #1837

Closed
hyperair wants to merge 1 commit into
jsforce:mainfrom
hyperair:update-refreshtoken
Closed

hyperair wants to merge 1 commit into
jsforce:mainfrom
hyperair:update-refreshtoken

Conversation

@hyperair

@hyperair hyperair commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

If Refresh Token Rotation (RTR) is enabled for the oauth client, Salesforce will rotate the refreshToken and return a new one in the response under the refresh_token key. When that happens, we need to update conn.refreshToken or the next refresh on the same connection object will fail.

This PR fixes that by passing refreshToken into the conn._establish call if refresh_token is present in the response.

Users will need to extract the refresh token from res.refresh_token if it's present.

If Refresh Token Rotation (RTR) is enabled for the oauth client, Salesforce will rotate the
refreshToken and return a new one in the response. When that happens, we need
to update `conn.refreshToken` or the next refresh on the same connection object
will fail.
@hyperair

Copy link
Copy Markdown
Contributor Author

Superseded by #1864.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant