Skip to content

Commit

Permalink
increase minimum password length
Browse files Browse the repository at this point in the history
  • Loading branch information
torhoehn committed Nov 16, 2024
1 parent 6acfd6a commit f189ff8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/User/Model/UserValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UserValidationRules
/**
* Minimum length of admin password
*/
public const MIN_PASSWORD_LENGTH = 7;
public const MIN_PASSWORD_LENGTH = 12;

/**
* Adds validation rule for user first name, last name, username and email
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Bootstrap
* Predefined admin user credentials
*/
public const ADMIN_NAME = 'user';
public const ADMIN_PASSWORD = 'password1';
public const ADMIN_PASSWORD = 'password1234';
public const ADMIN_EMAIL = 'admin@example.com';
public const ADMIN_FIRSTNAME = 'firstname';
public const ADMIN_LASTNAME = 'lastname';
Expand Down
4 changes: 2 additions & 2 deletions lib/web/mage/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,13 @@ define([
return false;
}

if (pass.length < 7) {
if (pass.length < 12) {
return false;
}

return true;
},
$.mage.__('Please enter 7 or more characters, using both numeric and alphabetic.')
$.mage.__('Please enter 12 or more characters, using both numeric and alphabetic.')
],
'validate-customer-password': [
function (v, elm) {
Expand Down
2 changes: 1 addition & 1 deletion setup/src/Magento/Setup/Fixtures/AdminUsersFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function execute()
->setFirstName('Firstname')
->setLastName('Lastname')
->setUserName('admin' . $i)
->setPassword('123123q')
->setPassword('1234512345q!')
->setIsActive(1);
$adminUser->save();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public function testExecute(): void
{
$options = [
'--' . AdminAccount::KEY_USER => 'user',
'--' . AdminAccount::KEY_PASSWORD => '123123q',
'--' . AdminAccount::KEY_PASSWORD => '1234512345q!',
'--' . AdminAccount::KEY_EMAIL => 'test@test.com',
'--' . AdminAccount::KEY_FIRST_NAME => 'John',
'--' . AdminAccount::KEY_LAST_NAME => 'Doe'
];
$data = [
AdminAccount::KEY_USER => 'user',
AdminAccount::KEY_PASSWORD => '123123q',
AdminAccount::KEY_PASSWORD => '1234512345q!',
AdminAccount::KEY_EMAIL => 'test@test.com',
AdminAccount::KEY_FIRST_NAME => 'John',
AdminAccount::KEY_LAST_NAME => 'Doe',
Expand Down

0 comments on commit f189ff8

Please sign in to comment.