1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

fixup! Add a two-step setup of OTP

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf 2025-07-20 19:12:54 +02:00
parent 38f82f3175
commit 8a72a5ac9d
3 changed files with 4 additions and 8 deletions

View file

@ -8,11 +8,10 @@ use Doctrine\DBAL\Schema\Schema;
use Wallabag\Doctrine\WallabagMigration;
/**
* Add boolean for two-step setup for google authenticator
* Add boolean for two-step setup for google authenticator.
*/
final class Version20250413133131 extends WallabagMigration
{
public function up(Schema $schema): void
{
$userTable = $schema->getTable($this->getTable('user'));

View file

@ -269,9 +269,6 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
$this->emailTwoFactor = $emailTwoFactor;
}
/**
* @param bool $googleAuthenticator
*/
public function setGoogleAuthenticator(bool $googleAuthenticator): void
{
$this->googleAuthenticator = $googleAuthenticator;

View file

@ -1231,7 +1231,7 @@ class ConfigControllerTest extends WallabagTestCase
$googleAuthenticatorMock
->method('checkCode')
->willReturnCallback(function ($user, $code) {
return $code === '123456';
return '123456' === $code;
});
$this->logInAs('admin');
@ -1289,7 +1289,7 @@ class ConfigControllerTest extends WallabagTestCase
->findOneByUsername('admin');
$this->assertTrue($user->isGoogleTwoFactor());
$this->assertGreaterThan(0, count($user->getBackupCodes()));
$this->assertGreaterThan(0, \count($user->getBackupCodes()));
// Restore user
$user->setGoogleAuthenticatorSecret(null);