pikvm/pikvm#1459: Extended TOTP window with a single step (+30sec)

This commit is contained in:
Maxim Devaev 2025-01-16 14:57:05 +02:00
parent 8631ee8555
commit 3f3a834c0c

View File

@ -95,7 +95,7 @@ class AuthManager:
secret = file.read().strip()
if secret:
code = passwd[-6:]
if not pyotp.TOTP(secret).verify(code):
if not pyotp.TOTP(secret).verify(code, valid_window=1):
get_logger().error("Got access denied for user %r by TOTP", user)
return False
passwd = passwd[:-6]