title: Laravel 6.0 authentication error : Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() must be an instance of Lcobucci\JWT\Signer\Key
body: <p>My backend project is based on Laravel 6.0 and I want to test the logout API in postman.</p>
  <p>I am using the <code>Jwt middleware</code> for user authentication.</p>
  <p>I already run the following commands.</p>
  <pre><code>php artisan cache:clear
  php artisan config:clear
  php artisan key:generate
  php artisan jwt:secret
  </code></pre>
  <p>But still occurs this error:</p>
  <pre><code>Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() must be an instance of Lcobucci\JWT\Signer\Key
  </code></pre>
  <p>Here is my <code>jwt</code> middleware.</p>
  <pre><code>class Jwt extends BaseMiddleware
  {
      /**
       * Handle an incoming request.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \Closure  $next
       * @return mixed
       */
      public function handle($request, Closure $next)
      {
          try {
              $user = JWTAuth::parseToken()-&gt;authenticate();
          } catch (Exception $e) {
              if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException){
                  return response()-&gt;json(['status' =&gt; 'Token is Invalid']);
              }else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException){
                  return response()-&gt;json(['status' =&gt; 'Token is Expired']);
              }else{
                  return response()-&gt;json(['status' =&gt; 'Authorization Token not found']);
              }
          }
          return $next($request);
      }
  }
  </code></pre>
  <p>Here is my route file for APIs.</p>
  <pre><code>    Route::group(['prefix' =&gt; 'user', 'namespace' =&gt; 'API\User', 'middleware' =&gt; ['assign.guard:users']], function () {
      Route::post('login', 'AuthController@login');
      Route::post('register', 'AuthController@register');
      Route::group(['middleware' =&gt; 'jwt.verify'], function () {
          Route::get('logout', 'AuthController@logout');
      });
  });
  </code></pre>
  <p>And here is the logout function of AuthController.</p>
  <pre><code>    public function logout(Request $request)
      {
          return response()-&gt;json([
              'success' =&gt; true,
              'token' =&gt; 'Only authorize users can see this message',
          ]);
      }
  </code></pre>
  <p>And, finally, here is the postman screenshot to test API:</p>
  <p><a href="https://i.stack.imgur.com/b1Qzh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b1Qzh.png" alt="enter image description here" /></a></p>
  <p>Hope your help.</p>