Skip to content

Commit

Permalink
get rid of the refresh toke
Browse files Browse the repository at this point in the history
  • Loading branch information
longshuicy committed May 16, 2024
1 parent deb9c0d commit c25fc02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion www/routes/auth/google_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ router.get('/login/google/callback', checkIfLoggedIn, (req, res) => {
return res.status(400).send({ ERROR: error.message });
}
setCredential(req, 'google_access_token', tokens.access_token);
setCredential(req, 'google_refresh_token', tokens.refresh_token);
res.redirect('/query');
});
});
Expand Down
5 changes: 1 addition & 4 deletions www/routes/search/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ router.post('/query-dryrun', checkIfLoggedIn, function (req, res) {
'Content-Type': 'application/json',
'redditaccesstoken': obj['rd_access_token'],
'googleaccesstoken': obj['google_access_token'],
'googlerefreshtoken': obj['google_refresh_token'],
'twtaccesstokenkey': obj['twt_access_token_key'],
'twtaccesstokensecret': obj['twt_access_token_secret'],
'twtbearertoken': obj['twt_v2_access_token']
Expand Down Expand Up @@ -85,7 +84,6 @@ router.post('/query', checkIfLoggedIn, function (req, res) {
'Content-Type': 'application/json',
'redditaccesstoken': obj['rd_access_token'],
'googleaccesstoken': obj['google_access_token'],
'googlerefreshtoken': obj['google_refresh_token'],
'twtaccesstokenkey': obj['twt_access_token_key'],
'twtaccesstokensecret': obj['twt_access_token_secret'],
'twtbearertoken': obj['twt_v2_access_token']
Expand Down Expand Up @@ -371,7 +369,6 @@ function removeInvalidToken(req, platform) {
removeCredential(req, 'rd_access_token');
} else if (platform === 'youtube') {
removeCredential(req, 'google_access_token');
removeCredential(req, 'google_refresh_token');
}
}

Expand Down Expand Up @@ -409,7 +406,7 @@ function checkAuthorized(req) {
if (obj && 'twt_access_token_key' in obj && 'twt_access_token_secret' in obj) response['twitter'] = true;
if (obj && 'twt_v2_access_token' in obj) response['twitterV2'] = true;
if (obj && 'rd_access_token' in obj) response['reddit'] = true;
if (obj && 'google_access_token' in obj && 'google_refresh_token' in obj) response['youtube'] = true;
if (obj && 'google_access_token' in obj) response['youtube'] = true;
resolve(response);
});
}
Expand Down

0 comments on commit c25fc02

Please sign in to comment.