Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$jwt typing error on AccessToken\Verify #2641

Open
gaea44 opened this issue Nov 25, 2024 · 0 comments
Open

$jwt typing error on AccessToken\Verify #2641

gaea44 opened this issue Nov 25, 2024 · 0 comments

Comments

@gaea44
Copy link

gaea44 commented Nov 25, 2024

Environment details

  • OS: Linux Mint 21.3
  • PHP version: 8.3.14
  • Package name and version: google/apiclient v2.18.1

Steps to reproduce

  1. instanciate a new Google Client with a $jwt oject
$client = new Google\Client();
$jwt = new Firebase\JWT\JWT();
$jwt::$leeway = 50;

$client->setConfig('jwt', $jwt);
  1. Call VerifyIdToken with the client
$client->verifyIdToken($someApiToken);
  1. A 500 error is thrown
    Google\\AccessToken\\Verify::__construct(): Argument #3 ($jwt) must be of type ?string, Firebase\\JWT\\JWT given, called in \/home\/bbousba\/dev\/provider-api\/vendor\/google\/apiclient\/src\/Client.php on line 848

The error is due to the newly ?string typing in src/AccessToken/Verify.php l.72 where it should be ?Firebase\JWT\JWT

public function __construct(
    ClientInterface $http = null,
    CacheItemPoolInterface $cache = null,
    ?string $jwt = null
)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant