Problem/Motivation

https://www.drupal.org/pift-ci-job/2739778

Running automated tests with php 8.1 and Drupal 10.1 generates a couple fatal errors:

Drupal\Tests\users_jwt\Kernel\UsersJwtRequestTest
exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-7.xml:
PHPUnit Test failed to complete; Error: PHPUnit 9.6.8 by Sebastian Bergmann and contributors.


There was 1 error:

1) Drupal\Tests\users_jwt\Kernel\UsersJwtRequestTest::testAuth
Error: Firebase\JWT\JWT::decode(): Argument #3 ($headers) cannot be passed by reference

/var/www/html/modules/contrib/jwt/modules/users_jwt/src/Authentication/Provider/UsersJwtAuth.php:103

Proposed resolution

Figure out how to fix this in a way that's compatible with JWT 5.5 and 6.x

CommentFileSizeAuthor
#2 3381022-2.patch1.72 KBpwolanin

Comments

pwolanin created an issue. See original summary.

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new1.72 KB

Looks like this bugs happens when using the JWT library >= 6.6.0

A 3rd param was removed before, than added back differently for the decode() call.

pwolanin’s picture

Priority: Normal » Major
pwolanin’s picture

Title: test failures php 8.1 Drupal 10.1 » JWT library >= 6.6.0 causes fatal (test failures on php 8.1 Drupal 10.1)
ebeyrent’s picture

Patch looks sane to me

ebeyrent’s picture

Status: Needs review » Reviewed & tested by the community
pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

Thanks Erich

  • pwolanin committed 883ee08a on 2.x
    Issue #3381022 by pwolanin | ebeyrent: JWT library >= 6.6.0 causes fatal...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.