Closed rahuldebsarder closed 7 years ago
I have fixed this issue by modify saveAccessToken function
protected function saveAccessToken($token) {
if(isset($token['access_token'],$token['expires']))
{
$this->setState('auth_token', $token['access_token']);
$this->setState('expires', isset($token['expires']) ? time() + (int)$token['expires'] - 60 : 0);
$this->access_token = $token['access_token'];
}else{
$token2 = array_keys($token);
if(isset($token2[0]))
{
$token_v2 = json_decode($token2[0],1);
if(isset($token_v2['access_token'],$token_v2['expires_in']))
{
$this->setState('auth_token', $token_v2['access_token']);
$this->setState('expires', isset($token_v2['expires_in']) ? time() + (int)$token_v2['expires_in'] - 60 : 0);
$this->access_token = $token_v2['access_token'];
}
}
}
}
Same problem!!!
same
Fixed in v1.2.0
Undefined index: access_token because i have got: $token = array ( [{"access_token":"EAAZA1CJKCPiMBAIamWdYhAPnC4Ydz63VVvumf0qYDZB7FzHCaFjRXgeZCiI1JYCaBiYHKaR4wKTdBfO1ku3jGfQA0J55ZAibUgDYnUxp5iAgLkHlWbdUCXXNuXu4LEhd9bX2P8DlEPvCnMVc4yy1dt8Pks7HouNBbAZCrXahOLAZDZD","token_type":"bearer","expires_in":5173282}] => );
So create Undefined index: access_token error in this line: $this->setState('auth_token', $token['access_token']);