mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Bound TOTP rotation wait in account tests
This commit is contained in:
1 parent
3a41e0620a
commit
ea72585c5b
1 file changed
+8
-2
@@ -133,12 +133,18 @@ final class AccountCustomClientTest extends Scope
|
||||
|
||||
protected function getNextTOTP(\OTPHP\TOTP $totp, string $previousOtp): string
|
||||
{
|
||||
$deadline = time() + 35;
|
||||
|
||||
do {
|
||||
sleep(1);
|
||||
$otp = $totp->now();
|
||||
} while ($otp === $previousOtp);
|
||||
|
||||
return $otp;
|
||||
if ($otp !== $previousOtp) {
|
||||
return $otp;
|
||||
}
|
||||
} while (time() < $deadline);
|
||||
|
||||
$this->fail('TOTP did not rotate within the expected time window.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user