@ -60,7 +60,7 @@ class TokenAuthentication extends Authentication
if ($this->token->isExpired() && isset($this->refresh_callback))
{
$callback = $this->refresh_callback;
$this->token = $callback($this);
$this->token = $callback($this->token);
}
return $request->withHeader('Authorization', 'Bearer '.$this->token->getAccessToken());
@ -35,6 +35,6 @@ class ServiceAccountFlow
*/
public function getServiceAccountToken(): Token
return $this->client->createTokenFromClient();
$token = $this->client->createTokenFromClient();