title: laravel jwt-auth Token is Invalid
body: <p>I built an api in Laravel using tymondesigns/jwt-auth to authenticate users.</p>
  
  <p>I followed the tutorial on <a href="https://github.com/tymondesigns/jwt-auth/wiki" rel="nofollow">github</a> and the login is working correctly:</p>
  
  <pre><code>public function login() {
          if (!$token = JWTAuth::attempt(Input::only('email', 'password'))) {
              return response()-&gt;json(['error' =&gt; true], HttpResponse::HTTP_UNAUTHORIZED);
          }
  
          $user = User::where('email', Input::get('email'))-&gt;first();
  
          return response()-&gt;json(array(
              'user' =&gt; $user, 
              'token' =&gt; compact('token')['token'])
          );
      }
  </code></pre>
  
  <p>And for the response I got the token.</p>
  
  <p>But every time I try to use the toke I got:</p>
  
  <pre><code>[
    "Token is invalid"
  ]
  </code></pre>
  
  <p>ie:</p>
  
  <pre><code>public function getUser() {
          $token = JWTAuth::getToken();
          return response()-&gt;json(JWTAuth::toUser($token));
      }
  </code></pre>
  
  <p>This is a GET to <code>{{url}}/api/getUser</code> with the header <code>Authorization: Bearer {{token}}</code></p>
  
  <p>my routes.php contains the following:</p>
  
  <pre><code>Route::group(array('prefix' =&gt; 'api'), function() {
      Route::post('/login', 'API\UserController@login');
      Route::get('/getUser', ['before' =&gt; 'jwt-auth', 'uses' =&gt; 'API\UserController@getUser']);
  });
  </code></pre>
  
  <p>How can I make this working with the token? Am I missing something here?</p>
  
  <p>UPDATE:</p>
  
  <p>I got a token like this:</p>
  
  <pre><code>eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL3NtYXJ0YXBwXC9hcGlcL2xvZ2luIiwiaWF0IjoxNDY2Mjc5ODUxLCJleHAiOjE0NjYyODM0NTEsIm5iZiI6MTQ2NjI3OTg1MSwianRpIjoiYjNkZjViZGNiMjQ2YWU0NzVlZDYwODQxMWFlZDNkMTAifQ.pqU0pWKVzmOel51ObyE9vKLk07tefh2lDE-fp-AOavE
  </code></pre>
  
  <p>After I check the token on <a href="https://jwt.io" rel="nofollow">https://jwt.io</a>, I got invalid signature.
  Why I'm getting and invalid signature, and how can I make it valid?</p>