summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Social/Google/Base.php8
-rw-r--r--src/Social/OAuth2.php1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/Social/Google/Base.php b/src/Social/Google/Base.php
index c3c8879..b2869a0 100644
--- a/src/Social/Google/Base.php
+++ b/src/Social/Google/Base.php
@@ -142,7 +142,10 @@ abstract class Base extends \Social\Connection implements \Social\Auth
*/
protected static function httpError($info, $result=null, $request=null)
{
- if (is_object($result) && $result->error) return $result->error->code . ' - ' . $result->error->message;
+ if (is_object($result) && $result->error) {
+ return is_object($result->error) ? $result->error->code . ' - ' . $result->error->message : $result->error;
+ }
+
return parent::httpError($info, $result, $request);
}
@@ -177,7 +180,8 @@ abstract class Base extends \Social\Connection implements \Social\Auth
*/
protected function fetchAccessToken(array $params)
{
- return $this->post(static::oauthUrl . 'token', $params);
+ $info = $this->post(static::oauthUrl . 'token', $params);
+ return $info;
}
/**
diff --git a/src/Social/OAuth2.php b/src/Social/OAuth2.php
index 0e66fec..b633e99 100644
--- a/src/Social/OAuth2.php
+++ b/src/Social/OAuth2.php
@@ -309,6 +309,7 @@ trait OAuth2
$this->accessToken = $data->access_token;
$this->accessExpires = isset($expires_in) ? time() + $expires_in : null;
+ $this->refreshToken = isset($data->refresh_token) ? $data->refresh_token : null;
if ($this->authUseSession) $_SESSION[static::serviceProvider . ':access'] = $this->getAccessInfo();