title: Auth::login() not working properly laravel 5.7
body: <p>I'm trying to setup 'Login with facebook' using laravel socialite. When I try to login, it gets a successful callback from the facebook, I'm storing the data fetched into the database and try to redirect to home page. While doing so, I am redirected back to the login page and never reaching the homepage.</p>
  <p>While debugging the error I found that my Auth::login($user) is not working properly.</p>
  <p>Here is the code-</p>
  <p><strong>AuthController.php</strong></p>
  <pre><code>use App\Http\Controllers\Controller;
  use Laravel\Socialite\Two\InvalidStateException;
  use Auth;
  use Socialite;
  use App\User;
  
  public function redirectToProvider($provider)
  {
      return Socialite::driver($provider)-&gt;redirect();
  }
  
  public function handleProviderCallback($provider)
  {
      $user = Socialite::driver($provider)-&gt;user();
      // dd($user);
      $authUser = $this-&gt;findOrCreateUser($user, $provider);
      // dd($authUser);
      if(Auth::login($authUser, true)){            // here is the error
        return redirect($this-&gt;redirectTo);
      }
      else{
        return 'Login not done';                 //this prints out to the screen
      }
  }
  
  public function findOrCreateUser($user, $provider)
   {
       $authUser = User::where('id', $user-&gt;id)-&gt;first();
       if ($authUser) {
           return $authUser;
       }
       return User::create([
           'name'     =&gt; $user-&gt;name,
           'email'    =&gt; $user-&gt;email,
           'avatar'    =&gt; $user-&gt;avatar,
           'password'    =&gt; bcrypt('password'),
           'provider' =&gt; $provider,
           'id' =&gt; $user-&gt;id
       ]);
   }
  </code></pre>
  <p>Do let me know what am I doing wrong.</p>
  <p>This is what I'm getting while dd($authUser)</p>
  <p><a href="https://i.stack.imgur.com/mrvd1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mrvd1.png" alt="enter image description here" /></a></p>