1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-06-17 00:07:45 +02:00

Refactor the rate limiting code

Rate limiting was already redesigned to use Python limits. This
introduced some unexpected behavior, including the fact that only
one criteria is supported per limiter. Docs and setup utility are
updated with this in mind.

Also, the code was made more generic, so limiters can be delivered
for something else than authentication. Authentication-specific
code was moved directly to the authentication routine.
This commit is contained in:
kaiyou
2020-02-09 17:38:18 +01:00
parent 7507345ce9
commit 8e88f1b8c3
8 changed files with 53 additions and 55 deletions

View File

@ -20,7 +20,7 @@ def handle_needs_login():
)
# Rate limiter
limiter = limiter.Limiter()
limiter = limiter.LimitWraperFactory()
# Application translation
babel = flask_babel.Babel()