Here is my config socialite for lumen but I got error:
Fatal error: Call to a member function set() on null
Any idea?
my AuthController
namespace App\Http\Controllers;
use Socialite;
class AuthController extends Controller {
public function redirectToProvider() {
return Socialite :: driver('github')->redirect();
}
public function handleProviderCallback() {
$user = Socialite :: driver('github')->user();
dd( $user );
}
}
my Route.php
$app->get('auth/github', 'AuthController@redirectToProvider');
$app->get('auth/github/callback', 'AuthController@handleProviderCallback');
my bootstrap/app.php added this
class_alias(Laravel\Socialite\Facades\Socialite::class, 'Socialite');
$app->register(Laravel\Socialite\SocialiteServiceProvider::class);
$app->configure('services');
my config/services
return [
'github' => [
'client_id' => '############',
'client_secret' => '#############',
'redirect' => 'my callback url',
],
];
**
Fatal error: Call to a member function set() on null in D:\xampp\htdocs\user-service\vendor\laravel\socialite\src\Two\AbstractProvider.php on line 134
Whoops, looks like something went wrong.
1/1
FatalErrorException in D:\xampp\htdocs\user-service\vendor\laravel\socialite\src\Two\AbstractProvider.php line 134:
Call to a member function set() on null
in AbstractProvider.php line 134
at Application->handleShutdown() in RegistersExceptionHandlers.php line 55
at Application->Laravel\Lumen\Concerns\{closure}()
**