diff --git a/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php b/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php index caec8610555..27f50cd29f8 100644 --- a/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php +++ b/plugins/TwoFactorAuth/Dao/TwoFaSecretRandomGenerator.php @@ -16,6 +16,6 @@ class TwoFaSecretRandomGenerator public function generateSecret() { $authenticator = new \TwoFactorAuthenticator(); - return $authenticator->createSecret(16); + return $authenticator->createSecret(32); } } diff --git a/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php b/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php index 17f59ab0770..f5ffa3ab6a2 100644 --- a/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php +++ b/plugins/TwoFactorAuth/tests/Integration/Dao/TwoFaSecretRandomGeneratorTest.php @@ -33,7 +33,7 @@ public function setUp(): void public function testGeneratorCodeLength() { - $this->assertSame(16, mb_strlen($this->generator->generateSecret())); + $this->assertSame(32, mb_strlen($this->generator->generateSecret())); } public function testGeneratorCodeAlwaysDifferent() diff --git a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php index ae03d86d537..ab455ea9a07 100644 --- a/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php +++ b/plugins/TwoFactorAuth/tests/Integration/TwoFactorAuthenticationTest.php @@ -56,7 +56,7 @@ public function setUp(): void public function testGenerateSecret() { - $this->assertSame(16, mb_strlen($this->twoFa->generateSecret())); + $this->assertSame(32, mb_strlen($this->twoFa->generateSecret())); } public function testIsUserRequiredToHaveTwoFactorEnabledNotByDefault()