Could not create token: Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes

Viewed 4287

Getting some error from JWT with Lumen:

Could not create token: Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes

https://github.com/tymondesigns/jwt-auth/issues/2059

Any suggestion to do a quick fix, it seems a bug in new version.

1 Answers

On this thread, two solutions has been proposed as quickfix:

Solution 1:

In config\jwt.php file Change 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class, to 'jwt' => Tymon\JWTAuth\Providers\JWT\Namshi::class, => It works for me <3

Solution 2:

lcobucci/jwt:3.4 has this problem, composer require lcobucci/jwt:3.3 can resolve it.

It seems to be a problem with the lastest jwt package release (3.4.0)

Related