mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 08:55:40 +00:00
Support for TOTP valid_window configuration (#2187)
This commit is contained in:
@@ -292,7 +292,8 @@ def check_otp_code(otp_secret_key, otp_code):
|
||||
if not otp_secret_key or not otp_code:
|
||||
return False
|
||||
totp = pyotp.TOTP(otp_secret_key)
|
||||
return totp.verify(otp_code)
|
||||
otp_valid_window = settings.OTP_VALID_WINDOW or 0
|
||||
return totp.verify(otp=otp_code, valid_window=otp_valid_window)
|
||||
|
||||
|
||||
def get_password_check_rules():
|
||||
|
Reference in New Issue
Block a user