Closed idpsycho closed 6 years ago
I have the same problem. Doesn't look like it's registering globally.
Registering middleware globaly in October changed somehow after updating to L5.5 so now I suggest using ->middleware('\Tymon\JWTAuth\Middleware\GetUserFromToken'); as @idpsycho offered.
Changed README according to this.
Will update when find out the new way of global registration.
Route::post('api/test', function (\Request $request) {})->middleware('jwt.auth');
I am getting error:
Class jwt.auth does not exist
\vendor\laravel\framework\src\Illuminate\Container\Container.php
It works fine when I replace it with the value from jwtauth/plugin.php boot():
// $this->app['router']->middleware('jwt.auth', '\Tymon\JWTAuth\Middleware\GetUserFromToken');
...->middleware('\Tymon\JWTAuth\Middleware\GetUserFromToken');
Any ideas?