fix rate-limit valid login bug and fix sessions of redis and psql in tests

This commit is contained in:
2026-09-05 21:55:31 +03:00
parent c4a6a88d05
commit 9fd44c0ad9
8 changed files with 50 additions and 30 deletions
+1 -2
View File
@@ -19,8 +19,7 @@ class RateLimit:
if attempts>5:
raise self.errors.rate_limit_error(detail="too many attempts", retry_after=60)
async def check_rate_limit(self, request: Request) -> None:
client_ip = request.headers.get('x-forwarded-for', '').split(',')[0].strip() or (request.client.host if request.client else 'unknown')
async def check_rate_limit(self, client_ip:str) -> None:
await self.rate_limit(client_ip)