Skip to content

Commit c1baf77

Browse files
fix: refresh token issue in salesforce (#120)
1 parent d0fa9e4 commit c1baf77

File tree

1 file changed

+6
-1
lines changed
  • integrationos-oauth/src/connections/salesforce

1 file changed

+6
-1
lines changed

integrationos-oauth/src/connections/salesforce/refresh.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export const refresh = async ({ body }: DataObject): Promise<OAuthResponse> => {
3131
data: { access_token: accessToken, token_type: tokenType },
3232
} = response;
3333

34+
let refreshToken = refresh_token;
35+
if (response.data.refresh_token) {
36+
refreshToken = response.data.refresh_token;
37+
}
38+
3439
// Get expiry time through introspection
3540
const introspection = await axios({
3641
url: `${baseUrl}/introspect`,
@@ -51,7 +56,7 @@ export const refresh = async ({ body }: DataObject): Promise<OAuthResponse> => {
5156

5257
return {
5358
accessToken,
54-
refreshToken: refresh_token,
59+
refreshToken,
5560
expiresIn,
5661
tokenType,
5762
meta: {

0 commit comments

Comments
 (0)