From 4b0f93540fd0c96eb876e5d3835c94524a624df7 Mon Sep 17 00:00:00 2001 From: garbelo Date: Wed, 28 Jan 2026 15:47:02 +0000 Subject: [PATCH] Update backend/beyond_api/security.py --- backend/beyond_api/security.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/beyond_api/security.py b/backend/beyond_api/security.py index be0e6ff..151ae19 100644 --- a/backend/beyond_api/security.py +++ b/backend/beyond_api/security.py @@ -35,9 +35,11 @@ def get_current_user(credentials: HTTPBasicCredentials | None = Depends(security # Guarrada maxima, yo no he sido correct_username = secrets.compare_digest(credentials.username, INT_USER) correct_password = secrets.compare_digest(credentials.password, INT_PASS) - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Credenciales incorrectas", - ) + # si no volvemos a hacer la comparación no va + if not (correct_username and correct_password): + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Credenciales incorrectas", + ) return credentials.username