mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 23:20:27 +00:00
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:
commit
7873e5f3f8
@ -94,7 +94,7 @@ class User(db.Model):
|
|||||||
|
|
||||||
def verify_totp(self, token):
|
def verify_totp(self, token):
|
||||||
totp = pyotp.TOTP(self.otp_secret)
|
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):
|
def get_hashed_password(self, plain_text_password=None):
|
||||||
# Hash a password for the first time
|
# Hash a password for the first time
|
||||||
|
Loading…
Reference in New Issue
Block a user