Merge pull request #256 from rene-dekkers/nonint_error

Fail when non-numeric otp token was inserted
This commit is contained in:
Khanh Ngo 2018-05-18 10:43:26 +07:00 committed by GitHub
commit 4daf6f72a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,7 +365,7 @@ def login():
# check if user enabled OPT authentication
if user.otp_secret:
if otp_token:
if otp_token and isinstance(otp_token, int):
good_token = user.verify_totp(otp_token)
if not good_token:
return render_template('login.html', error='Invalid credentials',