J'ai :
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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user