Skip to content

Commit

Permalink
refresh token fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince Ali Khan committed Dec 13, 2016
1 parent fca98e9 commit ea0363c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Factories/MauticFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ public function refreshToken($refreshToken)
]));
$responseBodyAsString = $response->getBody();
$responseBodyAsString = json_decode($responseBodyAsString,true);
return MauticConsumer::create($responseBodyAsString);

return MauticConsumer::create([
'access_token' => $responseBodyAsString['access_token'],
'expires' => time() + $responseBodyAsString['expires_in'],
'token_type' => $responseBodyAsString['token_type'],
'refresh_token' => $responseBodyAsString['refresh_token']
]);
}
catch (ClientException $e) {
return $exceptionResponse = $e->getResponse();
Expand Down

0 comments on commit ea0363c

Please sign in to comment.