title: Laravel combine Passport authentication and normal authentication
body: <p>How do I combine Passport authentication and normal laravel authentication? </p>
  
  <p>I want the user to be logged in on pages of web-middleware and api-middleware. The login route is in api-middleware. Currently I have set up Passport authentication and it works fine for all api-middleware routes. How to make the user logged in in web-middleware as well? </p>
  
  <p>Edit #1</p>
  
  <p>What Im doing:</p>
  
  <p>Login code</p>
  
  <pre><code>$http = new \GuzzleHttp\Client();
  
      try {
          $response = $http-&gt;post(config('services.passport.login_endpoint'), [
              'form_params' =&gt; [
                  'grant_type' =&gt; 'password',
                  'client_id' =&gt; config('services.passport.client_id'),
                  'client_secret' =&gt; config('services.passport.client_secret'),
                  'username' =&gt; $args['email'],
                  'password' =&gt; $args['password']
              ]
          ]);
  
          $user = User::where('email', $args['email'])-&gt;first();
  
          Auth::guard('web')-&gt;login($user);
          return [
              "token" =&gt; $response-&gt;getBody()-&gt;getContents(),
              "user" =&gt; $user
          ];
  
      } // ...
  </code></pre>
  
  <p>Somewhere in some web-middleware route</p>
  
  <pre><code>return auth()-&gt;check() ? "logged in" : "not logged in";
  </code></pre>
  
  <p>returns "not logged in"</p>