title: Why JWT redirect to login page. Laravel REST Api
body: <p>I'm deploying a RestApi with Laravel 5.5 and using JWT ("tymon/jwt-auth": "dev-develop") for authentication, PostMan for test and and Php 7.3.3-1. I followed all steps from the oficial website (<a href="https://jwt-auth.readthedocs.io/en/develop/" rel="nofollow noreferrer">JWT Tymon</a>).
  It works fine when I try to login, even it return the error when password or email is wrong. But when I try to access to the content which I want to share on Api, It returns Session store not set on request.</p>
  
  <p>This is my routes providers:</p>
  
  <pre><code>protected function mapResourcesv2()
      {
          Route::prefix('api')
              -&gt;middleware('api')
              -&gt;namespace($this-&gt;namespace)
              -&gt;group(base_path('routes/resources.php'));
  //        Route::group([
  //            'prefix' =&gt; 'api',
  //            'middleware' =&gt; 'auth:api',
  //            'namespace' =&gt; $this-&gt;namespace,
  //        ], function ($router) {
  //            require base_path('routes/resources.php');
  //        });
      }
  </code></pre>
  
  <p>The line comments is the routes which Im using in all my files (a lot of routes isn't good idea having all routes in one file) Only the no-comm line works fine.</p>
  
  <p>AuthController file is the same of the official website (<a href="https://jwt-auth.readthedocs.io/en/develop/quick-start/" rel="nofollow noreferrer">Quick-start</a>).</p>
  
  <p>And this is my LoginController:</p>
  
  <pre><code>    public function __construct(Request $request)
      {
          $this-&gt;middleware('guest', ['except' =&gt; ['logout', 'getLogout']]);
          $this-&gt;request = $request;
      }
  </code></pre>
  
  <pre><code>Route::group(
      [
          'middleware' =&gt; 'api',
          'prefix' =&gt; 'auth'
      ],
      function($router)
      {
          Route::post('login', 'AuthController@login');
          Route::post('logout', 'AuthController@logout');
          Route::post('refresh', 'AuthController@refresh');
          Route::post('me', 'AuthController@me');
          Route::group(
              [
                  'prefix' =&gt;  'product',
              ],
              function()
              {
                  Route::post('price/{id}', 'Resources\Entrypoint\Http\Laravel\Product\ProductGetController@getPrice');
                  Route::post('price', 'ProductPostController@changePrice');
              }
          );
      }
  );
  </code></pre>
  
  <p>This is the routes which returns the login page (both weren't edited, maybe should I edit something?)</p>
  
  <pre><code>Route::get('blackboard/login', 'Auth\LoginController@showBlackboardLogin');
  Route::post('blackboard/login', 'Auth\LoginController@postAdminLogin');
  </code></pre>
  
  <p>LoginController file:</p>
  
  <pre><code>    public function showBlackboardLogin(){
  
          return view('blackboard/login');
      }
  </code></pre>
  
  <pre><code>    public function postAdminLogin(Request $request){
          $request-&gt;session()-&gt;put('login',Carbon::now()-&gt;toDateTimeString());
          $conditions = [
                'email' =&gt; $this-&gt;request-&gt;input('email'),
                'password' =&gt; $this-&gt;request-&gt;input('password'),
                'active' =&gt; 1,
          ];
          if(Auth::attempt($conditions, $this-&gt;request-&gt;has('remember'))){
              return redirect('blackboard');
          }else{
              //TODO, mensaje mal
              return redirect('blackboard/login');
          }
      }
  </code></pre>
  
  <p>In postman I'm using "Authorization" tab and "type:Bearer Token" and pasted the token generated after login.</p>
  
  <p>The user should have access to the routes from '/product'.
  But it only works for login, if I try to access '/me' it redirect to login page (only login works and returns the error if password is wrong). Actually the error is <b>Session store not set on request.</b></p>