diff --git a/src/Controller/ConfigController.php b/src/Controller/ConfigController.php index aa6c250cb..fde92ddaa 100644 --- a/src/Controller/ConfigController.php +++ b/src/Controller/ConfigController.php @@ -312,7 +312,7 @@ class ConfigController extends AbstractController $user = $this->getUser(); - $user->setGoogleAuthenticatorSecret(null); + $user->setGoogleAuthenticatorSecret(''); $user->setGoogleAuthenticator(false); $user->setBackupCodes(null); diff --git a/tests/Controller/ConfigControllerTest.php b/tests/Controller/ConfigControllerTest.php index d0d557bc8..ae89203ad 100644 --- a/tests/Controller/ConfigControllerTest.php +++ b/tests/Controller/ConfigControllerTest.php @@ -1292,7 +1292,7 @@ class ConfigControllerTest extends WallabagTestCase $this->assertGreaterThan(0, \count($user->getBackupCodes())); // Restore user - $user->setGoogleAuthenticatorSecret(null); + $user->setGoogleAuthenticatorSecret(''); $user->setGoogleAuthenticator(false); $user->setBackupCodes([]); $em->persist($user); @@ -1328,7 +1328,7 @@ class ConfigControllerTest extends WallabagTestCase ->getRepository(User::class) ->findOneByUsername('admin'); - $this->assertNull($user->getGoogleAuthenticatorSecret()); + $this->assertEmpty($user->getGoogleAuthenticatorSecret()); $this->assertEmpty($user->getBackupCodes()); $this->assertFalse($user->isGoogleTwoFactor()); }