class SocialController extends Controller
{
- protected SocialAuthService $socialAuthService;
- protected RegistrationService $registrationService;
- protected LoginService $loginService;
-
- /**
- * SocialController constructor.
- */
public function __construct(
- SocialAuthService $socialAuthService,
- RegistrationService $registrationService,
- LoginService $loginService
+ protected SocialAuthService $socialAuthService,
+ protected RegistrationService $registrationService,
+ protected LoginService $loginService,
) {
$this->middleware('guest')->only(['register']);
- $this->socialAuthService = $socialAuthService;
- $this->registrationService = $registrationService;
- $this->loginService = $loginService;
}
/**
try {
return $this->socialAuthService->handleLoginCallback($socialDriver, $socialUser);
} catch (SocialSignInAccountNotUsed $exception) {
- if ($this->socialAuthService->driverAutoRegisterEnabled($socialDriver)) {
+ if ($this->socialAuthService->drivers()->isAutoRegisterEnabled($socialDriver)) {
return $this->socialRegisterCallback($socialDriver, $socialUser);
}
return $this->socialRegisterCallback($socialDriver, $socialUser);
}
- return redirect()->back();
+ return redirect('/');
}
/**
$this->socialAuthService->detachSocialAccount($socialDriver);
session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => Str::title($socialDriver)]));
- return redirect(user()->getEditUrl());
+ return redirect('/my-account/auth#social-accounts');
}
/**
{
$socialUser = $this->socialAuthService->handleRegistrationCallback($socialDriver, $socialUser);
$socialAccount = $this->socialAuthService->newSocialAccount($socialDriver, $socialUser);
- $emailVerified = $this->socialAuthService->driverAutoConfirmEmailEnabled($socialDriver);
+ $emailVerified = $this->socialAuthService->drivers()->isAutoConfirmEmailEnabled($socialDriver);
// Create an array of the user data to create a new user instance
$userData = [