tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.24k stars 1.55k forks source link

Class "Tymon\JWTAuth\Providers\JWT\Namshi" not found #2213

Open daniilly opened 1 year ago

daniilly commented 1 year ago

Subject of the issue

An attempt to create an instance of the Tymon\JWTAuth\Providers\JWT\Namshi class using the AbstractServiceProvider::registerNamshiProvider() method failed because the class does not exist anymore, as it was dropped in a recent commit: https://github.com/tymondesigns/jwt-auth/commit/b0868a5b00801889a9e0c81a737963d8004e708c#diff-f6d0165250945a702d3edc292ddd71188eaadef24c305ad994ae7c6e50fb7664

Your environment

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 9.49.0
Package version 2.0.0
PHP version 8.1.11

Steps to reproduce

We have code that calls Manager::encode:

...
/** @type Token $token */
$token = JWTAuth::manager()->encode($payload);
...

Following that, at a certain stage in the call chain, there is a call to AbstractServiceProvider::getConfigInstance("providers.jwt"), which subsequently triggers the resolution of AbstractServiceProvider::registerNamshiProvider(). As a result, an attempt is made to instantiate the removed class.

Expected behavior

To get encoded Token

Actual behaviour

Error: Class "Tymon\JWTAuth\Providers\JWT\Namshi" not found

ABouchard55 commented 1 year ago

From what I found, it was changed (back, I think) to Lcobucci because Namshi is deprecated.