async def _validate_slack_token(self, token: str, name: Optional[str]) -> str:
        """Validate a Slack token by making a test API call.

        Args:
            token: The Slack token to validate
            name: The user-provided connection name

        Returns:
            The connection name (possibly enriched with team info)

        Raises:
            HTTPException: If the token is invalid
        """
        try:
            async with httpx.AsyncClient() as client:
                headers = {
                    "Authorization": f"Bearer {token}",
                    "Content-Type": "application/json",
                }
                response = await client.get("https://slack.com/api/auth.test", headers=headers)
                response.raise_for_status()
                data = response.json()

                if not data.get("ok", False):
                    raise HTTPException(
                        status_code=400,
                        detail=f"Invalid Slack token: {data.get('error', 'Unknown error')}",
                    )

                # Get the team name for a better connection name if not provided
                team_name = data.get("team", "Slack")
                return name if name else f"{team_name} Direct Token"
        except Exception as e:
            raise HTTPException(
                status_code=400, detail=f"Failed to verify Slack token: {str(e)}"
            ) from e
Validate a Slack token by making a test API call.

        Args:
            token: The Slack token to validate
            name: The user-provided connection name

        Returns:
            The connection name (possibly enriched with team info)

        Raises:
            HTTPException: If the token is invalid
        
backend/airweave/core/connection_service.py