Skip to content

Commit

Permalink
add log for verify_token (#5767)
Browse files Browse the repository at this point in the history
* add log for verify_token

* optimize code

* improve code
  • Loading branch information
likesclever authored Nov 15, 2023
1 parent a4e2e4a commit 87f7a29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions seahub/two_factor/models/totp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) 2012-2016 Seafile Ltd.


import logging
from binascii import unhexlify
import time

Expand Down Expand Up @@ -109,6 +108,8 @@ def verify_token(self, token):
verified = True
break
else:
logging.info('user input invalid token = %s, totp.token = %s, self.last_t = %s, totp.t = %s'
% (token, totp.token(), totp.t(), self.last_t))
verified = False

return verified

0 comments on commit 87f7a29

Please sign in to comment.