From ab74c63ae24ef86e373624d6928bd8e4d7f51f22 Mon Sep 17 00:00:00 2001 From: Adam Pippin Date: Thu, 15 Jul 2021 15:53:54 -0700 Subject: [PATCH] Fix issue with refreshing tokens --- src/Oidc/Authentication/TokenAuthentication.php | 2 +- src/Oidc/Flows/ServiceAccountFlow.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Oidc/Authentication/TokenAuthentication.php b/src/Oidc/Authentication/TokenAuthentication.php index cdc4cbb..ac689a0 100644 --- a/src/Oidc/Authentication/TokenAuthentication.php +++ b/src/Oidc/Authentication/TokenAuthentication.php @@ -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()); } diff --git a/src/Oidc/Flows/ServiceAccountFlow.php b/src/Oidc/Flows/ServiceAccountFlow.php index fdeab19..48b3dc7 100644 --- a/src/Oidc/Flows/ServiceAccountFlow.php +++ b/src/Oidc/Flows/ServiceAccountFlow.php @@ -35,6 +35,6 @@ class ServiceAccountFlow */ public function getServiceAccountToken(): Token { - return $this->client->createTokenFromClient(); + $token = $this->client->createTokenFromClient(); } }