diff --git a/src/Models/OAuth2.php b/src/Models/OAuth2.php index 9c7d51850..f983b95ca 100644 --- a/src/Models/OAuth2.php +++ b/src/Models/OAuth2.php @@ -1,5 +1,4 @@ checkTokens(); - return unserialize($this->attributes['access_token']); + return $this->attributes['access_token'] ? unserialize($this->attributes['access_token']) : ''; } /** @@ -190,7 +189,7 @@ class OAuth2 extends Model */ protected function checkTokens() { - $access_token = unserialize($this->access_token); + $access_token = $this->access_token ? unserialize($this->access_token) : ''; if (!empty($access_token) && $access_token->hasExpired()) { // Tentativo di refresh del token di accesso