mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Checked over and aligned registration option behavior across all auth options
- Added tests to cover
This commit is contained in:
@ -74,7 +74,7 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function getRegister()
|
||||
{
|
||||
$this->registrationService->checkRegistrationAllowed();
|
||||
$this->registrationService->ensureRegistrationAllowed();
|
||||
$socialDrivers = $this->socialAuthService->getActiveDrivers();
|
||||
return view('auth.register', [
|
||||
'socialDrivers' => $socialDrivers,
|
||||
@ -87,12 +87,13 @@ class RegisterController extends Controller
|
||||
*/
|
||||
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());
|
||||
|
Reference in New Issue
Block a user