Update backend/beyond_api/security.py
This commit is contained in:
@@ -35,6 +35,7 @@ def get_current_user(credentials: HTTPBasicCredentials | None = Depends(security
|
|||||||
# Guarrada maxima, yo no he sido
|
# Guarrada maxima, yo no he sido
|
||||||
correct_username = secrets.compare_digest(credentials.username, INT_USER)
|
correct_username = secrets.compare_digest(credentials.username, INT_USER)
|
||||||
correct_password = secrets.compare_digest(credentials.password, INT_PASS)
|
correct_password = secrets.compare_digest(credentials.password, INT_PASS)
|
||||||
|
if not (correct_username and correct_password):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail="Credenciales incorrectas",
|
detail="Credenciales incorrectas",
|
||||||
|
|||||||
Reference in New Issue
Block a user