add another ratelimit by username

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-10-28 20:22:51 +02:00
parent e1dc790165
commit 4385bafa85
1 changed files with 2 additions and 2 deletions

View File

@ -80,8 +80,8 @@ def login_deduct_when(resp):
return g.login_failed
@app.post("/login")
@limiter.limit("6/minute;10/day",
deduct_when=login_deduct_when)
@limiter.limit("6/minute;10/day", deduct_when=login_deduct_when)
@limiter.limit("6/minute;10/day", key_func=lambda:request.values.get("username").lower(), deduct_when=login_deduct_when)
def login_post():
template = ''
g.login_failed = True