changeset 9a032e4a0f0c in modules/web_user:default
details: https://hg.tryton.org/modules/web_user?cmd=changeset;node=9a032e4a0f0c
description:
        Add some random on the login delay

        issue8936
        review262681002
diffstat:

 user.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 230c83837dd1 -r 9a032e4a0f0c user.py
--- a/user.py   Sat Dec 07 16:11:44 2019 +0100
+++ b/user.py   Tue Jan 21 00:36:34 2020 +0100
@@ -361,7 +361,8 @@
         email = email.lower()
 
         # Prevent brute force attack
-        Transaction().atexit(time.sleep, 2 ** Attempt.count(email) - 1)
+        Transaction().atexit(
+            time.sleep, random.randint(0, 2 ** Attempt.count(email) - 1))
 
         users = cls.search([
                 ('email', '=', email),

Reply via email to