• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/ads/leadads/service.php
  • Класс: Bitrix\Crm\Controller\Ads\LeadAds\Service
  • Вызов: Service::logoutAction
public function logoutAction(string $type): AjaxJson
{
	if (!$service = $this->getService())
	{
		$this->addError(
			new Error("Service not available.")
		);

		return $this->errorResponse();
	}

	$account = $service->getAccount($type);
	$logoutResult = $account->logout();
	if ($logoutResult->isSuccess())
	{
		$this->unlinkWebForm($logoutResult->getData());
	}

	$groupAuthAdapter = $service->getGroupAuth($type);
	if ($groupAuthAdapter)
	{
		$groupAuthAdapter->removeAuth();
	}

	$service::getAuthAdapter($type)->removeAuth();

	return $this->successResponse();
}