auth: fix rate limit bypass, improve error messages

- Disable rate limiting when rate_limit_per_minute = 0
- Add IP lockout mention to 429 response
- Lowercase error messages for consistency
- Raise test mode rate limit 100 -> 10 (more realistic)
This commit is contained in:
2026-06-26 20:46:10 +02:00
parent 46d34efecb
commit 313bd1ebf3
3 changed files with 8 additions and 6 deletions

View File

@@ -638,7 +638,7 @@ app.add_middleware(SetupRedirectMiddleware)
import os
_test_mode = os.getenv("ANIWORLD_TESTING") == "1"
_auth_rate_limit = 100 if _test_mode else 5
_auth_rate_limit = 10 if _test_mode else 5
app.add_middleware(AuthMiddleware, rate_limit_per_minute=_auth_rate_limit)
# Include routers