[ 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 <kkorde@aistrike.com>
This commit is contained in:
korade-krushna 2025-05-27 19:06:20 +05:30 committed by GitHub
parent 0dd6c5b2b9
commit eca190dca6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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}`