X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/b8c16b15a9f945b72d2ca4fe0c0172ba422199bc..refs/pull/2784/head:/app/Http/Controllers/Auth/RegisterController.php diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 0bdeef9e6..7d7d8732b 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -2,11 +2,14 @@ namespace BookStack\Http\Controllers\Auth; +use BookStack\Actions\ActivityType; use BookStack\Auth\Access\RegistrationService; use BookStack\Auth\Access\SocialAuthService; use BookStack\Auth\User; use BookStack\Exceptions\UserRegistrationException; +use BookStack\Facades\Theme; use BookStack\Http\Controllers\Controller; +use BookStack\Theming\ThemeEvents; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; @@ -51,7 +54,6 @@ class RegisterController extends Controller $this->redirectTo = url('/'); $this->redirectPath = url('/'); - parent::__construct(); } /** @@ -94,6 +96,8 @@ class RegisterController extends Controller try { $user = $this->registrationService->registerUser($userData); auth()->login($user); + Theme::dispatch(ThemeEvents::AUTH_LOGIN, auth()->getDefaultDriver(), $user); + $this->logActivity(ActivityType::AUTH_LOGIN, $user); } catch (UserRegistrationException $exception) { if ($exception->getMessage()) { $this->showErrorNotification($exception->getMessage()); @@ -118,5 +122,4 @@ class RegisterController extends Controller 'password' => Hash::make($data['password']), ]); } - }