tenant arreglado
This commit is contained in:
23
backend/fix_ratelimit.py
Normal file
23
backend/fix_ratelimit.py
Normal file
@@ -0,0 +1,23 @@
|
||||
with open("/app/app/api/v1/endpoints/auth.py", "r") as f:
|
||||
content = f.read()
|
||||
|
||||
old = ''' # Rate limiting (best-effort): by (tenant,email) to slow brute force.
|
||||
ident_key = None
|
||||
if settings.RATE_LIMIT_ENABLED and not settings.TESTING:
|
||||
email_norm = login_data.email.strip().lower()
|
||||
ident_key = cache_key("rl", "login", "id", str(tenant.id), email_norm)'''
|
||||
|
||||
new = ''' # Rate limiting (best-effort): by (tenant,email) to slow brute force.
|
||||
ident_key = None
|
||||
if settings.RATE_LIMIT_ENABLED and not settings.TESTING and tenant:
|
||||
email_norm = login_data.email.strip().lower()
|
||||
ident_key = cache_key("rl", "login", "id", str(tenant.id), email_norm)'''
|
||||
|
||||
if old in content:
|
||||
content = content.replace(old, new)
|
||||
print("OK: rate limiting fix aplicado")
|
||||
else:
|
||||
print("ERROR: bloque no encontrado")
|
||||
|
||||
with open("/app/app/api/v1/endpoints/auth.py", "w") as f:
|
||||
f.write(content)
|
||||
Reference in New Issue
Block a user