Skip to content

Commit

Permalink
working createInitialRootUser
Browse files Browse the repository at this point in the history
  • Loading branch information
scammo committed Jan 8, 2024
1 parent 467d8d1 commit 2380eed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public function updatePassword(User $user, Request $request){
}

public function createInitialRootUser(){
return 'test';
if(User::where('username', 'root')->first()){
abort(403);
}
$user = new User();
$user->username = "root";
$user->email = "[email protected]";
$user->password = Hash::make("root&changeMe");
$user->save();
return $user;
}
}
}

0 comments on commit 2380eed

Please sign in to comment.