mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Исправлено поведение TOTP валидатора, если Closure для timestamp возвращает null
This commit is contained in:
@ -39,6 +39,13 @@ class TotpValidatorTest extends TestCase {
|
||||
$result = $this->callProtected($validator, 'validateValue', $controlTotp->at($at));
|
||||
$this->assertNull($result);
|
||||
|
||||
$at = function() {
|
||||
return null;
|
||||
};
|
||||
$validator->timestamp = $at;
|
||||
$result = $this->callProtected($validator, 'validateValue', $controlTotp->now());
|
||||
$this->assertNull($result);
|
||||
|
||||
$at = function() {
|
||||
return time() - 700;
|
||||
};
|
||||
|
Reference in New Issue
Block a user