I am building API endpoint with Laravel 5.8 using Passport and Socialite for authentication. API authentication with Passport works fine but I am getting a runtime exception error
Session store not set on request
when I try to authenticate using facebook. Here's how I have set up my code
API endpoints
Route::get('login/facebook', 'AuthController@facebookRedirect');
Route::get('login/facebook/callback', 'AuthController@facebookCallback');
Controller methods
public function facebookRedirect()
{
return Socialite::driver('facebook')->redirect();
}
public function facebookCallback()
{
return Socialite::driver('facebook')->stateless()->user();
}
Added the facebook key to service.php file like this
'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('FACEBOOK_CALLBACK_URL'),
],
How do I resolve this error?