From eca190dca63f5987c71d5cd5f471e6632f1790f8 Mon Sep 17 00:00:00 2001 From: korade-krushna <101387736+korade-krushna@users.noreply.github.com> Date: Tue, 27 May 2025 19:06:20 +0530 Subject: [PATCH] [ BUG #4498] Use Correct Key For Basic Auth and Optional Password (#4501) Use Correct Key For Basic Auth and Optional pass Co-authored-by: Krishna Korade --- packages/components/nodes/agentflow/HTTP/HTTP.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/nodes/agentflow/HTTP/HTTP.ts b/packages/components/nodes/agentflow/HTTP/HTTP.ts index 752d6dd0b..438c22eae 100644 --- a/packages/components/nodes/agentflow/HTTP/HTTP.ts +++ b/packages/components/nodes/agentflow/HTTP/HTTP.ts @@ -220,14 +220,14 @@ class HTTP_Agentflow implements INode { // Add credentials if provided const credentialData = await getCredentialData(nodeData.credential ?? '', options) if (credentialData && Object.keys(credentialData).length !== 0) { - const basicAuthUsername = getCredentialParam('username', credentialData, nodeData) - const basicAuthPassword = getCredentialParam('password', credentialData, nodeData) + const basicAuthUsername = getCredentialParam('basicAuthUsername', credentialData, nodeData) + const basicAuthPassword = getCredentialParam('basicAuthPassword', credentialData, nodeData) const bearerToken = getCredentialParam('token', credentialData, nodeData) const apiKeyName = getCredentialParam('key', credentialData, nodeData) const apiKeyValue = getCredentialParam('value', credentialData, nodeData) // Determine which type of auth to use based on available credentials - if (basicAuthUsername && basicAuthPassword) { + if (basicAuthUsername || basicAuthPassword) { // Basic Auth const auth = Buffer.from(`${basicAuthUsername}:${basicAuthPassword}`).toString('base64') requestHeaders['Authorization'] = `Basic ${auth}`