Closed alexjolig closed 2 years ago
What you limit by is not implemented in this library - it is left for the downstream client (for example Flask-Limiter
).
You can see some examples in the quickstart where consuming a limit (RateLimiter.hit) takes any number of identifiers
which are combined to form the key to limit by.
Thanks @alisaifee . Seems like adding it to hit
like this works to limit based on token, email, user id ,etc...
moving_window.hit(rate_limit_item, email)
Yeap! that's right.
Hi, how can I implement rate limit based on user id or token? I couldn't find the code where it checks IP to replace it with token.