Skip to content

Commit

Permalink
Oy
Browse files Browse the repository at this point in the history
  • Loading branch information
battis committed Apr 24, 2024
1 parent f419886 commit 23dcd31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/appengine-client/src/GoogleSecretsToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Battis\LazySecrets\Cache;
use Battis\OpenAPI\Client\TokenStorage;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;

class GoogleSecretsToken extends TokenStorage
Expand All @@ -25,7 +26,11 @@ public function __construct(mixed $projectId)

public function getToken(): ?AccessTokenInterface
{
return $this->secrets->get(self::ACCESS_TOKEN);
$result = $this->secrets->get(self::ACCESS_TOKEN);
if ($result != null) {
return new AccessToken($result);
}
return null;
}

public function setToken(AccessTokenInterface $token): bool
Expand Down

0 comments on commit 23dcd31

Please sign in to comment.