Just found out the answer here
Just for other who are wondering, I just figured out a way... In
SocialAuthController: use Illuminate\Http\Request;
Then make constructor as:
protected $request;
public function __construct (Request $request) {
$this->request = $request;
}
and then in callback() function:
if (isset($this->request['error'])) {
return redirect()->to('/error');
//make your error route or do whatever you want!!
} else {
// this is my code, your actual code will go here on success
print_r($service);
$service = new SocialAccountService();
$user = $service->createOrGetUser(Socialite::driver($provider));
$providerUser = \Socialite::driver('facebook')->user();
print_r($providerUser);
auth()->login($user);
return redirect()->to('/home');
}