mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 15:10:27 +00:00
Fix OTP validation
The result from the form is never an int but rather a string of digits, so that's what we should be checking for. This fixes OTP validation (cherry picked from commit 5fe3c8b9f92665db54d74dc6b2334666c318bf0c)
This commit is contained in:
parent
0fb6e10cf5
commit
5d40c42bbf
@ -365,7 +365,7 @@ def login():
|
||||
|
||||
# check if user enabled OPT authentication
|
||||
if user.otp_secret:
|
||||
if otp_token and isinstance(otp_token, int):
|
||||
if otp_token and otp_token.isdigit():
|
||||
good_token = user.verify_totp(otp_token)
|
||||
if not good_token:
|
||||
return render_template('login.html', error='Invalid credentials',
|
||||
|
Loading…
Reference in New Issue
Block a user