Skip to content

Commit

Permalink
fix(auth): access token storage
Browse files Browse the repository at this point in the history
  • Loading branch information
klieber committed Nov 22, 2020
1 parent f914b50 commit 8c91722
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/provider/dropbox/dropbox-client-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ module.exports = {
if (response.status < 200 || response.status >= 300) {
throw new Error('Unable to get access token from code');
}
token = response.result;
token = {
accessToken: response.result.access_token,
refreshToken: response.result.refresh_token,
accessTokenExpiresAt: new Date(Date.now() + response.result.expires_in)
};
}

const dropboxAuth = new DropboxAuth({
fetch: fetch,
clientId: config.client_id,
clientSecret: config.client_secret,
accessToken: token.access_token,
refreshToken: token.refresh_token,
accessTokenExpiresAt: new Date(Date.now() + token.expires_in)
accessToken: token.accessToken,
refreshToken: token.refreshToken,
accessTokenExpiresAt: token.accessTokenExpiresAt
});

logger.debug('refreshing access token');
Expand Down

0 comments on commit 8c91722

Please sign in to comment.