Merge pull request #1249 from unilogicbv/models_user_totp_valid_window

models/user.py: add non-zero valid_window to totp.verify
This commit is contained in:
Matt Scott 2022-12-08 22:05:34 -05:00 committed by GitHub
commit 7873e5f3f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ class User(db.Model):
def verify_totp(self, token):
totp = pyotp.TOTP(self.otp_secret)
return totp.verify(token)
return totp.verify(token, valid_window = 5)
def get_hashed_password(self, plain_text_password=None):
# Hash a password for the first time