Make sure 1st admin user creation does not fail with error 500 (#12119)

* Make sure 1st admin user creation does not fail with error 500

* Update MakeUserController.php

just init it to the default fail message

* Update MakeUserController.php

* just struggling with the github editor :P

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Orsiris de Jong 2020-09-22 14:41:52 +02:00 committed by GitHub
parent 1d23421ba1
commit 9b9b26a007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,8 @@ class MakeUserController extends InstallationController implements InstallerStep
'password' => 'required',
]);
$message = trans('install.user.failure');
try {
// only allow the first admin to be created
if (! $this->complete()) {
@ -73,7 +75,6 @@ class MakeUserController extends InstallationController implements InstallerStep
$user->setPassword($request->get('password'));
$res = $user->save();
$message = trans('install.user.failure');
if ($res) {
$message = trans('install.user.success');
$this->markStepComplete();