diff --git a/backend/src/core/auth.py b/backend/src/core/auth.py index 354a004..62c6567 100644 --- a/backend/src/core/auth.py +++ b/backend/src/core/auth.py @@ -100,13 +100,22 @@ 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