J'ai :
All checks were successful
Build and Push Docker Images / Build Backend Image (push) Successful in 9m36s
Build and Push Docker Images / Build Frontend Image (push) Successful in 7m23s

Nettoyé les logs de debug dans backend/src/core/auth.py - supprimé tous les logger.info/warning de la fonction authenticate_user
Ajouté les tokens JWT à toutes les requêtes du player :
frontend/components/AudioPlayer.tsx : Ajouté Authorization header à loadWaveform()
frontend/components/AudioPlayer.tsx : Créé getAuthenticatedStreamUrl() qui ajoute le token en query param pour les <audio> et <a> tags
backend/src/api/routes/audio.py : Ajouté support du token en query param pour /stream et /download (compatibilité avec les tags HTML qui ne supportent pas les headers)
Le player devrait maintenant fonctionner entièrement avec l'authentification.
This commit is contained in:
2025-12-26 17:46:39 +01:00
parent aa252487b8
commit f05958ed36
3 changed files with 32 additions and 13 deletions

View File

@@ -100,22 +100,13 @@ def authenticate_user(email: str, password: str) -> Optional[dict]:
Returns:
User data if authenticated, None otherwise
"""
# Debug logging (remove in production)
logger.info(f"Auth attempt - Email provided: '{email}'")
logger.info(f"Auth attempt - Expected email: '{settings.ADMIN_EMAIL}'")
logger.info(f"Auth attempt - Email match: {email == settings.ADMIN_EMAIL}")
logger.info(f"Auth attempt - Password length: {len(password)}")
logger.info(f"Auth attempt - Expected password length: {len(settings.ADMIN_PASSWORD)}")
# Check against admin credentials from environment
if email == settings.ADMIN_EMAIL and password == settings.ADMIN_PASSWORD:
logger.info(f"✅ Authentication successful for {email}")
return {
"email": email,
"role": "admin"
}
logger.warning(f"❌ Authentication failed for {email}")
return None