small fix

This commit is contained in:
Ricardo Espinoza
2020-02-01 18:20:23 -05:00
parent 94b13ddea2
commit 7d5bbadc9b

View File

@@ -17,7 +17,7 @@ export async function jiraSoftwareCloudApiRequest(this: IHookFunctions | IExecut
if (credentials === undefined) { if (credentials === undefined) {
throw new Error('No credentials got returned!'); throw new Error('No credentials got returned!');
} }
const data = Buffer.from(`${credentials!.email}:${(credentials.jiraVersion === 'server') ? credentials.password : credentials.apiKey }`).toString(BINARY_ENCODING); const data = Buffer.from(`${credentials!.email}:${(credentials.jiraVersion === 'server') ? credentials.password : credentials.apiToken }`).toString(BINARY_ENCODING);
const headerWithAuthentication = Object.assign({}, const headerWithAuthentication = Object.assign({},
{ Authorization: `Basic ${data}`, Accept: 'application/json', 'Content-Type': 'application/json' }); { Authorization: `Basic ${data}`, Accept: 'application/json', 'Content-Type': 'application/json' });
const options: OptionsWithUri = { const options: OptionsWithUri = {