1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-13 11:47:56 +03:00

Made a pass to clean up UserRepo

This commit is contained in:
Dan Brown
2022-02-13 12:56:26 +00:00
parent 9806907d53
commit 7a8505f812
9 changed files with 180 additions and 164 deletions

View File

@@ -2,6 +2,7 @@
namespace BookStack\Console\Commands;
use BookStack\Auth\Role;
use BookStack\Auth\UserRepo;
use BookStack\Exceptions\NotFoundException;
use Illuminate\Console\Command;
@@ -85,7 +86,7 @@ class CreateAdmin extends Command
}
$user = $this->userRepo->createWithoutActivity($validator->validated());
$this->userRepo->attachSystemRole($user, 'admin');
$user->attachRole(Role::getSystemRole('admin'));
$user->email_confirmed = true;
$user->save();