Open taos-thiagoaos opened 7 years ago
Getting the same error when using Laravel 5.4
Class Tymon\JWTAuth\Middleware\GetUserFromToken does not exist
Fixed by changing:
Tymon\JWTAuth\Middleware\GetUserFromToken::class
to
Tymon\JWTAuth\Http\Middleware\Authenticate::class
I see that in source code :) The middleware in alpha 2 and beta 1 change the name. And now, don't need more do declare in kernel.php, the new Provider already did that automatically.
The strange thing is that only happened the error when i started the system by phpunit
I had the same issue, and changing the name worked :) but for me it was also working fine before the change from outside phpunit. Does this mean that the library is loaded twice (with the old name and the new name) for calls outside phpunit? This worries me a little. Can someone help us find out why it was working from outside phpunit with the old name?
BTW. With the new name it works fine form curl and from phpunit so this is quite weird...
@gmann1982
now it gives: Class Tymon\\JWTAuth\\Middleware\\Authenticate does not exist
LOL, I hate it
this worked for me using [laravel 5.6 & jwt-auth 1.0]
'jwt.auth' => \Tymon\JWTAuth\Http\Middleware\Authenticate::class,
'jwt.refresh' => \TymonJWTAuth\MiddlewareRefreshToken::class
laravel 5.6+ & jwt-auth 1.0+
'jwt.auth' => \Tymon\JWTAuth\Http\Middleware\Authenticate::class,
'jwt.refresh' => \Tymon\JWTAuth\Http\Middleware\RefreshToken::class,
laravel 5.6+ & jwt-auth 1.0+
'jwt.auth' => \Tymon\JWTAuth\Http\Middleware\Authenticate::class, 'jwt.refresh' => \Tymon\JWTAuth\Http\Middleware\RefreshToken::class,
This worked for me
"laravel/framework": "^7.0"
"tymon/jwt-auth": "dev-develop"
When i run vendor/bin/phpunit show the error
But the application works like a charm in develop mode.
I test with class approach too
I was using alpha.2 (another Provider config) and now i test with this config using beta.1. Both work in development but in test throgth vendor/bin/phpunit no.
Need some config to work in test?