]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Access/RegistrationService.php
Extend /users API endpoint
[bookstack] / app / Auth / Access / RegistrationService.php
index 2aff6c37d5140c84644f75077cceea2cd25d43d1..68b17771d628552fe57a1d40fe7301774d43adb9 100644 (file)
@@ -6,6 +6,8 @@ use BookStack\Auth\User;
 use BookStack\Auth\UserRepo;
 use BookStack\Exceptions\UserRegistrationException;
 use BookStack\Facades\Activity;
+use BookStack\Facades\Theme;
+use BookStack\Theming\ThemeEvents;
 use Exception;
 
 class RegistrationService
@@ -71,6 +73,7 @@ class RegistrationService
         }
 
         Activity::add(ActivityType::AUTH_REGISTER, $socialAccount ?? $newUser);
+        Theme::dispatch(ThemeEvents::AUTH_REGISTER, $socialAccount ? $socialAccount->driver : auth()->getDefaultDriver(), $newUser);
 
         // Start email confirmation flow if required
         if ($this->emailConfirmationService->confirmationRequired() && !$emailConfirmed) {
@@ -83,7 +86,6 @@ class RegistrationService
                 $message = trans('auth.email_confirm_send_error');
                 throw new UserRegistrationException($message, '/register/confirm');
             }
-
         }
 
         return $newUser;
@@ -109,5 +111,4 @@ class RegistrationService
             throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), $redirect);
         }
     }
-
-}
\ No newline at end of file
+}