*/
public function __construct(SocialAuthService $socialAuthService, RegistrationService $registrationService)
{
- $this->middleware('guest')->only(['getRegister', 'postRegister']);
+ $this->middleware('guest');
+ $this->middleware('guard:standard');
$this->socialAuthService = $socialAuthService;
$this->registrationService = $registrationService;
$this->redirectTo = url('/');
$this->redirectPath = url('/');
- parent::__construct();
}
/**
*/
public function getRegister()
{
- $this->registrationService->checkRegistrationAllowed();
+ $this->registrationService->ensureRegistrationAllowed();
$socialDrivers = $this->socialAuthService->getActiveDrivers();
return view('auth.register', [
'socialDrivers' => $socialDrivers,
*/
public function postRegister(Request $request)
{
- $this->registrationService->checkRegistrationAllowed();
+ $this->registrationService->ensureRegistrationAllowed();
$this->validator($request->all())->validate();
$userData = $request->all();
try {
- $this->registrationService->registerUser($userData);
+ $user = $this->registrationService->registerUser($userData);
+ auth()->login($user);
} catch (UserRegistrationException $exception) {
if ($exception->getMessage()) {
$this->showErrorNotification($exception->getMessage());