Fix for when TOTP starts with 0
PyOTP wants the token as a string, by passing it as an int leading 0s get stripped and verification fails
This commit is contained in:
parent
6395d81916
commit
c7d43ce5cc
|
@ -90,7 +90,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(int(token))
|
return totp.verify(token)
|
||||||
|
|
||||||
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 a new issue