Skip to content

Commit 4e28b3f

Browse files
committed
Now using fetch-retry for unstable connections. Fixed a bug where another user's worklogs would show on oauth authentication
1 parent 6ae989b commit 4e28b3f

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

controllers/jiraAPIController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fetch = require('node-fetch');
1+
const fetch = require('@adobe/node-fetch-retry');
22
const https = require('https');
33

44
function getDefaultHeaders(req) {

controllers/jiraController.js

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ exports.getUsersWorkLogsAsEvent = function(req, start, end) {
2929
if (process.env.JIRA_BASIC_AUTH_USERNAME) {
3030
condition = condition && worklog.author.emailAddress == process.env.JIRA_BASIC_AUTH_USERNAME;
3131
}
32+
if (process.env.JIRA_AUTH_TYPE =="OAUTH") {
33+
condition = condition && worklog.author.emailAddress == req.user.email;
34+
}
3235
return condition;
3336
})
3437
.map(worklog => {

package-lock.json

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"start": "node ./bin/www"
77
},
88
"dependencies": {
9+
"@adobe/node-fetch-retry": "^2.2.0",
910
"cookie-parser": "~1.4.4",
1011
"dayjs": "^1.11.10",
1112
"debug": "~2.6.9",

0 commit comments

Comments
 (0)