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

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',