From 9a283c49cd223ce40dc3a39027381ffc668e453e Mon Sep 17 00:00:00 2001 From: samme-abdul <65304480+samme-abdul@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:47:55 +0500 Subject: [PATCH] Fix OAuth config check for undefined values Updated the OAuth configuration check to ensure 'oauth_con_id' is not undefined before proceeding. This prevents potential issues when 'oauth_con_id' is missing from the config data and makes the first check true if it is undefined --- packages/core/src/Components/APICall/APICall.class.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/Components/APICall/APICall.class.ts b/packages/core/src/Components/APICall/APICall.class.ts index 8446e13b..8161a9d0 100644 --- a/packages/core/src/Components/APICall/APICall.class.ts +++ b/packages/core/src/Components/APICall/APICall.class.ts @@ -115,7 +115,7 @@ export class APICall extends Component { let _error: any = undefined; try { // To support both old and new OAuth configuration, we check for both oauth_con_id and oauthService. - if ((config?.data?.oauth_con_id !== '' && config?.data?.oauth_con_id !== 'None') || (config?.data?.oauthService !== '' && config.data.oauthService !== 'None')) { + if ((config?.data?.oauth_con_id !== undefined && config?.data?.oauth_con_id !== '' && config?.data?.oauth_con_id !== 'None') || (config?.data?.oauthService !== '' && config.data.oauthService !== 'None')) { const additionalParams = extractAdditionalParamsForOAuth1(reqConfig); const oauthHeaders = await generateOAuthHeaders(agent, config, reqConfig, logger, additionalParams); //reqConfig.headers = { ...reqConfig.headers, ...oauthHeaders };