use Laravel\Socialite\Contracts\Factory as Socialite;
use Laravel\Socialite\Contracts\Provider;
use Laravel\Socialite\Contracts\User as SocialUser;
+use Laravel\Socialite\Two\GoogleProvider;
use SocialiteProviders\Manager\SocialiteWasCalled;
use Symfony\Component\HttpFoundation\RedirectResponse;
// When a user is not logged in and a matching SocialAccount exists,
// Simply log the user into the application.
if (!$isLoggedIn && $socialAccount !== null) {
- $this->loginService->login($socialAccount->user, $socialAccount);
+ $this->loginService->login($socialAccount->user, $socialDriver);
return redirect()->intended('/');
}
{
$driver = $this->socialite->driver($driverName);
- if ($driverName === 'google' && config('services.google.select_account')) {
+ if ($driver instanceof GoogleProvider && config('services.google.select_account')) {
$driver->with(['prompt' => 'select_account']);
}
- if ($driverName === 'azure') {
- $driver->with(['resource' => 'https://graph.windows.net']);
- }
if (isset($this->configureForRedirectCallbacks[$driverName])) {
$this->configureForRedirectCallbacks[$driverName]($driver);