changeset 36ef4d3110c2 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=36ef4d3110c2
description:
        Add some random on the login delay

        issue8936
        review262681002
diffstat:

 trytond/res/user.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r bb6009606dde -r 36ef4d3110c2 trytond/res/user.py
--- a/trytond/res/user.py       Mon Jan 20 22:25:12 2020 +0100
+++ b/trytond/res/user.py       Tue Jan 21 00:36:34 2020 +0100
@@ -622,7 +622,7 @@
         if count > config.getint('session', 'max_attempt', default=5):
             LoginAttempt.add(login)
             raise RateLimitException()
-        Transaction().atexit(time.sleep, 2 ** count - 1)
+        Transaction().atexit(time.sleep, random.randint(0, 2 ** count - 1))
         for method in config.get(
                 'session', 'authentications', default='password').split(','):
             try:

Reply via email to