title: how to refresh token in jwt using lumen?
body: <p>I using lumen(5.2) framework and jwt(1.0).</p>
  
  <p>I get a token but i can't refresh it ,because the system tell me "The token has been blacklisted". I don't know how solved it. could you please help me.</p>
  
  <p>Forgive me, My English isn't very good, There may be some differences in expression.</p>
  
  <h1>Route</h1>
  
  <pre><code>$app-&gt;group(['prefix' =&gt; 'auth', 'namespace' =&gt; '\App\Http\Controllers'], function () use ($app) {
      $app-&gt;post('/signin', 'AuthController@signin');
      $app-&gt;put('/refresh', ['middleware' =&gt; ['before' =&gt; 'jwt.auth', 'after' =&gt; 'jwt.refresh'], 'uses' =&gt; 'AuthController@refresh']);
  });
  </code></pre>
  
  <h1>Sign in</h1>
  
  <pre><code>public function signin(Request $request)
  {
      $this-&gt;validate($request, [
          'email'    =&gt; 'required|email|max:255',
          'password' =&gt; 'required'
      ]);
  
      try {
  
          if ($token = $this-&gt;jwt-&gt;attempt($request-&gt;only(['email', 'password']))) {
              return $this-&gt;json([
                  'token' =&gt; $token
              ]);
          }
  
          return $this-&gt;json([], 403, $this-&gt;_lang['signin_incorrect']);
  
      } catch (JWTException $e) {
          return $this-&gt;json([], 500, $e-&gt;getMessage());
      }
  
  }
  </code></pre>
  
  <h1>Refresh</h1>
  
  <pre><code>public function refresh()
  {
  
      try {
          $this-&gt;jwt-&gt;setToken($this-&gt;jwt-&gt;getToken());
  
          if($this-&gt;jwt-&gt;invalidate()) {
              return $this-&gt;json([
                  'token' =&gt; $this-&gt;jwt-&gt;refresh()
              ]);
          }
  
          return $this-&gt;json([], 403, $this-&gt;_lang['token_incorrect']);
  
  
      } catch (JWTException $e) {
          return $this-&gt;json([], 500, $e-&gt;getMessage());
      }
  }
  </code></pre>
  
  <h1>Auth Service Provider</h1>
  
  <pre><code>public function boot()
  {
      // Here you may define how you wish users to be authenticated for your Lumen
      // application. The callback which receives the incoming request instance
      // should return either a User instance or null. You're free to obtain
      // the User instance via an API token or any other method necessary.
  
      $this-&gt;app['auth']-&gt;viaRequest('api', function ($request)
      {
          return \App\Models\User::where('email', $request-&gt;input('email'))-&gt;first();
      });
  }
  </code></pre>