Open stryct911 opened 8 years ago
Im not sure if Socialite can work with custom guards. Never tried it but when i find some time i will try to make it work. When i look into Socialite doc's i think it should work. Did you add methods from docs to your guard's AuthController?
/**
* Redirect the user to the GitHub authentication page.
*
* @return Response
*/
public function redirectToProvider()
{
return Socialite::driver('github')->redirect();
}
/**
* Obtain the user information from GitHub.
*
* @return Response
*/
public function handleProviderCallback()
{
$user = Socialite::driver('github')->user();
// $user->token;
}
Yes, it returns back correctly, its failing on logging in.
Don't forget:
/**
* Obtain the user information from GitHub.
*
* @return Response
*/
public function handleProviderCallback($provider)
{
$user = Socialite::driver($provider)->user();
$authUser = $this->findOrCreateUser($user, $provider);
Auth::guard('admin')->login($authUser, true);
return redirect($this->redirectTo);
}
If your guard is admin
Its not working for me when Auth::guard('admin')->login($authUser, true)
Its not working for me too
I am trying to use Socialite (facebook login in particular). Based on the setup instructions and any tutorials I have found, I get the following error:
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of Laravel\Socialite\Two\User given, called in xxxxx/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on line 294 and defined
Is it possible, the two can work togeather?