From 148c86563b2de664617459549271253e8b07afe0 Mon Sep 17 00:00:00 2001 From: garbelo Date: Wed, 28 Jan 2026 15:48:29 +0000 Subject: [PATCH] Update backend/beyond_api/security.py --- backend/beyond_api/security.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/beyond_api/security.py b/backend/beyond_api/security.py index be0e6ff..08b7963 100644 --- a/backend/beyond_api/security.py +++ b/backend/beyond_api/security.py @@ -35,9 +35,10 @@ 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", - ) + if not (correct_username and correct_password): + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Credenciales incorrectas", + ) return credentials.username