Skip to content

Commit

Permalink
fix: Google authentication doesn’t work if the client secret file doe…
Browse files Browse the repository at this point in the history
…sn’t have a redirect URL
  • Loading branch information
Finesse committed Jun 3, 2018
1 parent 633ffaf commit b5cdaee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/GoogleAPI/GoogleAPIClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function authenticate(
$this->client->setApplicationName('Forikal Tools');
$this->client->setScopes($scopes);
$this->client->setAccessType('offline');
$this->client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');

$this->logger->info('Getting the Google API client secret from the `'.$clientSecretFile.'` file');
$this->client->setAuthConfig($this->loadCredentialJSON($clientSecretFile));
Expand Down
1 change: 1 addition & 0 deletions tests/GoogleAPI/GoogleAPIClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ protected function setUp()
->getMock();
$this->googleClientMock->method('setApplicationName')->with('Forikal Tools');
$this->googleClientMock->method('setAccessType')->with('offline');
$this->googleClientMock->method('setRedirectUri');

$this->loggerMock = $this->createMock(LoggerInterface::class);
}
Expand Down

0 comments on commit b5cdaee

Please sign in to comment.