Compare commits

..

6 Commits

Author SHA1 Message Date
675573a472 Merge pull request 'corregido la guarrada' (#2) from desarrollo into main
Reviewed-on: #2
2026-01-28 15:48:44 +00:00
148c86563b Update backend/beyond_api/security.py 2026-01-28 15:48:29 +00:00
d3af112bdf revert 4b0f93540f
revert Update backend/beyond_api/security.py
2026-01-28 15:47:51 +00:00
4b0f93540f Update backend/beyond_api/security.py 2026-01-28 15:47:02 +00:00
3caea45730 Merge pull request '-Guarrada urgente pra entregar usaurio distinto.' (#1) from desarrollo into main
Reviewed-on: #1
2026-01-28 15:31:01 +00:00
b488c1bff6 Update backend/beyond_api/security.py 2026-01-28 15:26:29 +00:00

View File

@@ -12,6 +12,9 @@ security = HTTPBasic(auto_error=False)
BASIC_USER = os.getenv("BASIC_AUTH_USERNAME", "beyond")
BASIC_PASS = os.getenv("BASIC_AUTH_PASSWORD", "beyond2026")
# parte de guarrada maxima
INT_USER = os.getenv("INT_AUTH_USERNAME", "beyond")
INT_PASS = os.getenv("INT_AUTH_PASSWORD", "beyond2026")
def get_current_user(credentials: HTTPBasicCredentials | None = Depends(security)) -> str:
"""
@@ -28,6 +31,10 @@ def get_current_user(credentials: HTTPBasicCredentials | None = Depends(security
correct_username = secrets.compare_digest(credentials.username, BASIC_USER)
correct_password = secrets.compare_digest(credentials.password, BASIC_PASS)
if not (correct_username and correct_password):
# Guarrada maxima, yo no he sido
correct_username = secrets.compare_digest(credentials.username, INT_USER)
correct_password = secrets.compare_digest(credentials.password, INT_PASS)
if not (correct_username and correct_password):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,