Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sources/29-web2py-english/09.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,8 @@ def verify_otp(user, otp):
for t in range(time_start - 1, time_end + 1):
to_hash = str(t) + user.motp_secret + user.motp_pin
hash = md5(to_hash).hexdigest()[:6]
# Comment the previous line and uncomment the next line if using Python 3.
# hash = md5(to_hash.encode(encoding='utf8')).hexdigest()[:6]
if otp == hash:
return hash

Expand Down