def METHOD_NAME(self, *args, **kwargs):
    """Intercept regular login functionality to forbid it when using alternate auth."""
    if os.getenv(ALTERNATE_AUTH_ENV_VAR) is not None:
        raise CraftError(
            f"Cannot login when using alternative auth through {ALTERNATE_AUTH_ENV_VAR} "
            "environment variable."
        )
    return super().METHOD_NAME(*args, **kwargs)