fix rate-limit valid login bug and fix sessions of redis and psql in tests
This commit is contained in:
Vendored
+1
-2
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user