mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Обновлён Spomky-Labs/otphp до 9.0.2 версии
This commit is contained in:
@ -48,7 +48,7 @@ class ForgotPasswordFormTest extends TestCase {
|
||||
$model->validateTotpToken('token');
|
||||
$this->assertEquals(['error.token_incorrect'], $model->getErrors('token'));
|
||||
|
||||
$totp = new TOTP(null, 'secret-secret-secret');
|
||||
$totp = TOTP::create('BBBB');
|
||||
$model = new ForgotPasswordForm();
|
||||
$model->login = 'AccountWithEnabledOtp';
|
||||
$model->token = $totp->now();
|
||||
|
@ -76,7 +76,7 @@ class LoginFormTest extends TestCase {
|
||||
$account = new AccountIdentity(['password' => '12345678']);
|
||||
$account->password = '12345678';
|
||||
$account->is_otp_enabled = true;
|
||||
$account->otp_secret = 'mock secret';
|
||||
$account->otp_secret = 'AAAA';
|
||||
|
||||
$this->specify('error.token_incorrect if totp invalid', function() use ($account) {
|
||||
$model = $this->createModel([
|
||||
@ -88,7 +88,7 @@ class LoginFormTest extends TestCase {
|
||||
$this->assertEquals(['error.token_incorrect'], $model->getErrors('token'));
|
||||
});
|
||||
|
||||
$totp = new TOTP(null, 'mock secret');
|
||||
$totp = TOTP::create($account->otp_secret);
|
||||
$this->specify('no errors if password valid', function() use ($account, $totp) {
|
||||
$model = $this->createModel([
|
||||
'password' => '12345678',
|
||||
|
Reference in New Issue
Block a user