Skip to content

Commit

Permalink
Make the min password length dynamic instead of hardcoded one
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Dec 4, 2023
1 parent 6cd4f7a commit 6fd2ab7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ private function setIntegrationConfig(array $values): array {
if (key_exists('setup_project_folder', $values) && $values['setup_project_folder'] === true) {
$isSystemReady = $this->openprojectAPIService->isSystemReadyForProjectFolderSetUp();
if ($isSystemReady) {
$password = $this->secureRandom->generate(10, ISecureRandom::CHAR_HUMAN_READABLE);
$minPasswordLength = (int)$this->config->getAppValue('password_policy', 'minLength', '10');
$password = $this->secureRandom->generate($minPasswordLength, ISecureRandom::CHAR_HUMAN_READABLE);
$user = $this->userManager->createUser(Application::OPEN_PROJECT_ENTITIES_NAME, $password);
$group = $this->groupManager->createGroup(Application::OPEN_PROJECT_ENTITIES_NAME);
$group->addUser($user);
Expand Down

0 comments on commit 6fd2ab7

Please sign in to comment.