#458 fixes on tests, validator and model/user

This commit is contained in:
Antonio Cordeddu
2022-08-10 13:15:08 +02:00
parent d25012ad02
commit 5ee14138bc
3 changed files with 4 additions and 3 deletions

View File

@ -252,7 +252,7 @@ class User extends ActiveRecord implements IdentityInterface
'twoFactorSecretLength' => ['auth_tf_key', 'string', 'max' => 16],
'twoFactorEnabledNumber' => ['auth_tf_enabled', 'boolean'],
'twoFactorTypeLength' => ['auth_tf_type', 'string', 'max' => 20],
'twoFactorTypeLength' => ['auth_tf_mobile_phone', 'string', 'max' => 20],
'twoFactorMobilePhoneLength' => ['auth_tf_mobile_phone', 'string', 'max' => 20],
];
}

View File

@ -16,7 +16,7 @@ use Da\TwoFA\Manager;
use Da\User\Contracts\ValidatorInterface;
use Da\User\Model\User;
use Da\User\Traits\ContainerAwareTrait;
use Da\User\Service\TwoFactorEmailCodeGeneratorService;
use Da\User\Service\TwoFactorQrCodeUriGeneratorService;
use Yii;
class TwoFactorCodeValidator implements ValidatorInterface
@ -94,6 +94,6 @@ class TwoFactorCodeValidator implements ValidatorInterface
*/
public function generateCode()
{
return $this->make(TwoFactorEmailCodeGeneratorService::class,[$this->user])->run();
return $this->make(TwoFactorQrCodeUriGeneratorService::class,[$this->user])->run();
}
}