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:
Robert Kerr 2018-11-18 10:23:47 +00:00
parent 6395d81916
commit c7d43ce5cc

View file

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