Skip to content

Commit

Permalink
Merge pull request #115 from thotam/2.x
Browse files Browse the repository at this point in the history
Fix Request is missing required authentication credential
  • Loading branch information
masbug authored Oct 2, 2023
2 parents c18d9e4 + ef29cff commit a66d22e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/GoogleDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,14 @@ public function refreshToken()
{
$client = $this->service->getClient();
if ($client->isAccessTokenExpired()) {
$client->getCache()->clear();
if ($client->isUsingApplicationDefaultCredentials()) {
$client->fetchAccessTokenWithAssertion();
} else {
$refreshToken = $client->getRefreshToken();
if ($refreshToken) {
$client->fetchAccessTokenWithRefreshToken($refreshToken);
$this->service = new Drive($client);
}
}
}
Expand Down

0 comments on commit a66d22e

Please sign in to comment.