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:
parent
38f82f3175
commit
8a72a5ac9d
3 changed files with 4 additions and 8 deletions
|
@ -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'));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue