You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your report and for providing the code snippet reproducing the issue.
We’re aware that the HOTP methods (interface and implementation) use the parameter name “window,” whereas the TOTP method uses “leeway.” This difference is intentional, as the TOTP specification refers to the permissible time drift (leeway) rather than a counter-based window.
Version(s) affected
14.3
Description
When using named arguments window: as from the interface
Interface: \OTPHP\OTPInterface
public function verify(string $otp, null|int $input = null, null|int $window = null): bool;
HOTP
public function verify(string $otp, null|int $counter = null, null|int $window = null): bool
TOTP
public function verify(string $otp, null|int $timestamp = null, null|int $leeway = null): bool
The interface and HOTP both use window the TOTP uses name leeway
This results in error "Unknown named parameter 'Window'"
How to reproduce
$totp = TOTP::create( '{SECRET}', 60, 'sha256', 12 ); $totp->verify('verify_code',window:'window');
Possible Solution
align argument names
Additional Context
No response
The text was updated successfully, but these errors were encountered: