Skip to content

Commit

Permalink
getAccessToken now returns the parsed response object with two proper…
Browse files Browse the repository at this point in the history
…ties: user and access_token as described here: https://www.instagram.com/developer/authentication/
  • Loading branch information
marvinosswald committed Feb 12, 2018
1 parent 4313c4c commit 0b3624f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ public function getAccessToken($code)
'redirect_uri' => $this->redirectUri,
'code' => $code
]]);
$body = (string) $res->getBody();
$this->accessToken = $body->access_token;
return $this->accessToken;

$json = json_decode((string) $res->getBody());
$this->accessToken = $json->access_token;
return $json;
}
}

0 comments on commit 0b3624f

Please sign in to comment.