Skip to content
This repository has been archived by the owner on Apr 7, 2019. It is now read-only.

Commit

Permalink
Always send the client id and secret
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Apr 2, 2018
1 parent bb28bc1 commit 6c241b5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/LoginClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,9 @@ public function user(Session $session, string $state, string $code)
public function getToken(string $code)
{
return $this->requestToken([
'client_id' => $this->config->clientId,
'client_secret' => $this->config->clientSecret,
'code' => $code,
'grant_type' => 'authorization_code',
'redirect_uri' => $this->config->redirectUrl,
'code' => $code,
'grant_type' => 'authorization_code',
'redirect_uri' => $this->config->redirectUrl,
]);
}

Expand Down Expand Up @@ -191,10 +189,15 @@ public function refreshToken(string $refresh)
*/
protected function requestToken(array $params)
{
$client = [
'client_id' => $this->config->clientId,
'client_secret' => $this->config->clientSecret,
];

try {
$response = $this->client->post($this->provider->getTokenUrl(), [
'headers' => ['Accept' => 'application/json'],
'form_params' => $params,
'form_params' => array_merge($client, $params),
]);
} catch (Exception $e) {
throw new NoAccessTokenException('We were unable to retrieve your access token.', $e->getCode(), $e);
Expand Down

0 comments on commit 6c241b5

Please sign in to comment.