Skip to content

Invalid argument supplied for foreach() in firebase/php-jwt/src/JWT.php:422 #2243

@bstanleynep

Description

@bstanleynep

Pull request #2235 updated this package's composer.json file to allow firebase/php-jwt v6.

firebase/php-jwt v6 changed the method signatures for both JWT::encode() and JWT::decode(). It seems that the calls in this library to this method were not updated accordingly.

From the firebase/php-jwt change log

The second argument of JWT::decode now must be Firebase\JWT\Key or array<string, Firebase\JWT\Key> (see firebase/php-jwt#376)
JWT::encode requires third argument $alg (see firebase/php-jwt#376)

The offending decode call is in src/AccessToken/Verify.php(106): Firebase\\JWT\\JWT::decode()

I will follow up this issue with a PR.

Environment details

  • OS: Ubuntu 20.04
  • PHP version: 7.4.28
  • Package name and version: 2.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions