Skip to content

Commit b5529cf

Browse files
committed
more Oauth error catching, privacy notice update
1 parent 9790f9d commit b5529cf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

PRIVACY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This application does not store any data, or generate any logs locally.
44
Any data retrieved from Atlassian's APIs is immediately processed and returned to the user.
5-
The only exception is the OAuth 2.0 tokens and refresh tokens, which are stored in the user's session on the server, then deleted when it expires.
5+
The only exception is the OAuth 2.0 tokens and refresh tokens, which are stored in the user's session on the server, then deleted when it expires. As of now, those sessions are only stored in RAM.
66
The session cookie is stored and managed by the user's browser, so it is their responsability to ensure their browser is secure.
77

88
The program uses HTTPS requests between itself and Atlassian's APIs, unless disabled by the user, and uses HTTP by default between the user and itself.
9-
It is *not* intended to be exposed publicly, but rather installed in a secure environment and accessed locally. (For example, on a secure server, on a secure network, accessed locally by secure clients.)
9+
It is *not* intended to be exposed publicly, but rather installed in a secure environment and accessed locally. (For example, on a secure server, on a secure network, accessed locally by secure clients.). HTTPS Support will be coming eventually, it will be the user's responsability to set up appropriate SSL certificates then.
1010

1111

1212
This program is not designed to collect any data, not now, not ever.

controllers/jiraAPIController.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,19 @@ async function withRetry(fetchFn, req, ...args) {
7070
async function refreshToken(req) {
7171
if (req.user) {
7272
const refreshToken = req.user.refreshToken;
73-
console.log(req.user.refreshToken);
7473
try {
74+
console.log('Refreshing token');
7575
const response = await fetch('https://auth.atlassian.com/oauth/token', {
7676
method: 'POST',
7777
headers: {
7878
'Content-Type': 'application/x-www-form-urlencoded'
7979
},
80+
agent:httpsAgent,
8081
body: `grant_type=refresh_token&refresh_token=${refreshToken}&client_id=${process.env.JIRA_OAUTH_CLIENT_ID}&client_secret=${process.env.JIRA_OAUTH_CLIENT_SECRET}`
8182
});
8283

8384
const data = await response.json();
85+
8486

8587
if (data.error) {
8688
throw new Error(data.error);

0 commit comments

Comments
 (0)