title: Socialite stateless auth
body: <p>I have a front-end SPA built on Angular 6 and back-end on Laravel 5.6. I'm trying to make a facebook auth using <code>ngx-social-login</code> on the front-end and a <code>Socialite</code> on the back-end.</p>
  
  <p>That is code in my component</p>
  
  <pre><code>signInWithFacebook(): void {
    this.sas.signIn(FacebookLoginProvider.PROVIDER_ID).then(
      userData =&gt; this.as.fb(userData.authToken).subscribe(x =&gt; {
        console.log(x);
      })
    );
  }
  </code></pre>
  
  <p>And this is a service</p>
  
  <pre><code>fb(data): Observable&lt;any&gt; {
    return this.http.get(this.API_URL, data);
  }
  </code></pre>
  
  <p>And here is my Laravel routes</p>
  
  <pre><code>$api-&gt;version('v1', function ($api) {
      $api-&gt;get('auth/facebook', 'SocialAuthFacebookController@redirectToProvider');
      $api-&gt;get('auth/facebook/callback', 'SocialAuthFacebookController@callback');
  });
  </code></pre>
  
  <p>That is a controller</p>
  
  <pre><code>public function redirectToProvider()
      {
          return Socialite::driver('facebook')-&gt;stateless()-&gt;redirect();
      }
  
      public function callback()
      {
          $user = Socialite::driver('facebook')-&gt;stateless()-&gt;user();
  
          $authUser = $this-&gt;findOrCreateUser($user, 'facebook');
  
          $token = JWTAuth::fromUser($authUser);
  
          return Response::json(compact('token'));
      }
  
      public function findOrCreateUser($user, $provider)
      {
          $authUser = User::where('provider_id', $user-&gt;id)-&gt;first();
  
          if ($authUser) {
              return $authUser;
          }
  
          return User::create([
              'name' =&gt; $user-&gt;name,
              'email' =&gt; $user-&gt;email,
              'provider' =&gt; $provider,
              'provider_id' =&gt; $user-&gt;id
          ]);
      }
  </code></pre>
  
  <p>Since I'm using Laravel as an API-only so I suppose that I cannot access <code>redirectToProvider</code> so that I tried to call <code>auth/facebook/callback</code> and pass it an <code>authToken</code> that I get after a login on my SPA. However, it doesn't seem to work.</p>
  
  <p>I'm experiencing the next error
  <a href="https://i.stack.imgur.com/ihc9Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ihc9Y.png" alt="enter image description here"></a></p>
  
  <p>Thanks to Facebook there is so much information so that I don't know what's wrong and what to do with it.</p>