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