Skip to content

Commit 614ba84

Browse files
committed
auth tokens base64 only for jira
1 parent 577001e commit 614ba84

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

commit-msg-matcher/dist/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31128,7 +31128,9 @@ async function requestIssue(ticket) {
3112831128
let authMethod = 'Bearer'
3112931129

3113031130
if (ticket.board == 'jira') {
31131-
authToken = jiraAccessToken;
31131+
authToken = Buffer.from(
31132+
jiraAccessToken
31133+
).toString('base64');
3113231134
authMethod = 'Basic';
3113331135
}
3113431136

@@ -31140,9 +31142,7 @@ async function requestIssue(ticket) {
3114031142
const response = await fetch(ticket.ticketUri(), {
3114131143
method: 'GET',
3114231144
headers: {
31143-
'Authorization': `${authMethod} ${Buffer.from(
31144-
authToken
31145-
).toString('base64')}`,
31145+
'Authorization': `${authMethod} ${authToken}`,
3114631146
'Accept': 'application/json'
3114731147
}
3114831148
});

commit-msg-matcher/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ async function requestIssue(ticket) {
3535
let authMethod = 'Bearer'
3636

3737
if (ticket.board == 'jira') {
38-
authToken = jiraAccessToken;
38+
authToken = Buffer.from(
39+
jiraAccessToken
40+
).toString('base64');
3941
authMethod = 'Basic';
4042
}
4143

@@ -47,9 +49,7 @@ async function requestIssue(ticket) {
4749
const response = await fetch(ticket.ticketUri(), {
4850
method: 'GET',
4951
headers: {
50-
'Authorization': `${authMethod} ${Buffer.from(
51-
authToken
52-
).toString('base64')}`,
52+
'Authorization': `${authMethod} ${authToken}`,
5353
'Accept': 'application/json'
5454
}
5555
});

0 commit comments

Comments
 (0)