]> BookStack Code Mirror - bookstack/blobdiff - app/Console/Commands/CreateAdmin.php
Added OIDC group sync functionality
[bookstack] / app / Console / Commands / CreateAdmin.php
index c3faef79c306a3ed518e3fadb38cb930d4a9878d..e4660314d6e4365676a23049d7b825fa32a95f5b 100644 (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;
@@ -84,9 +85,8 @@ class CreateAdmin extends Command
             return SymfonyCommand::FAILURE;
         }
 
-        $user = $this->userRepo->create($validator->validated());
-        $this->userRepo->attachSystemRole($user, 'admin');
-        $this->userRepo->downloadAndAssignUserAvatar($user);
+        $user = $this->userRepo->createWithoutActivity($validator->validated());
+        $user->attachRole(Role::getSystemRole('admin'));
         $user->email_confirmed = true;
         $user->save();