From af03a69bfda767b0e370d4d9d0ad4ca96dfd9b65 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 12 Apr 2021 19:55:17 +0200 Subject: [PATCH] Set default password policy length to 10 Signed-off-by: Roeland Jago Douma --- lib/PasswordPolicyConfig.php | 3 +-- tests/lib/PasswordPolicyConfigTest.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PasswordPolicyConfig.php b/lib/PasswordPolicyConfig.php index e13f87a1..51ff5ec1 100644 --- a/lib/PasswordPolicyConfig.php +++ b/lib/PasswordPolicyConfig.php @@ -53,8 +53,7 @@ public function __construct(IConfig $config) { * @return int */ public function getMinLength(): int { - $minLength = $this->config->getAppValue('password_policy', 'minLength', '8'); - return (int)$minLength; + return (int)$this->config->getAppValue('password_policy', 'minLength', '10'); } /** diff --git a/tests/lib/PasswordPolicyConfigTest.php b/tests/lib/PasswordPolicyConfigTest.php index 2a84f5cb..a9249640 100644 --- a/tests/lib/PasswordPolicyConfigTest.php +++ b/tests/lib/PasswordPolicyConfigTest.php @@ -45,7 +45,7 @@ public function testGetMinLength() { $expected = 42; $this->config->expects($this->once())->method('getAppValue') - ->with('password_policy', 'minLength', '8') + ->with('password_policy', 'minLength', '10') ->willReturn($appConfigValue); $this->assertSame($expected,