From ea0363ceecb0c0a118b2335f8187e04a9661a4e8 Mon Sep 17 00:00:00 2001 From: Prince Ali Khan Date: Tue, 13 Dec 2016 22:23:59 +0530 Subject: [PATCH] refresh token fix --- src/Factories/MauticFactory.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Factories/MauticFactory.php b/src/Factories/MauticFactory.php index 7f2791b..3c56075 100644 --- a/src/Factories/MauticFactory.php +++ b/src/Factories/MauticFactory.php @@ -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();