Skip to content

Commit

Permalink
Fix bugs around refreshing
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed Dec 26, 2020
1 parent 5f1c03a commit c0a5572
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/GoogleSpreadsheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ class OAuthClient {

if (isExpired) {
// refresh the token
const nextTokens = await refreshToken({
clientId: this.oAuthCredentials.clientId,
clientSecret: this.oAuthCredentials.clientSecret,
refreshToken: this.oAuthCredentials.refreshToken
})
const nextTokens = await this.refreshToken();
this.creds = { ...this.creds, ...nextTokens };
await this.oAuthRefreshCallback(nextTokens);
if (this.onRefreshTokens) {
await this.oAuthRefreshCallback(nextTokens);
}
}
return this.creds.accessToken;
}
Expand Down

0 comments on commit c0a5572

Please sign in to comment.