• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/google/manager.php
  • Класс: BitrixCalendarSyncGoogleManager
  • Вызов: Manager::handleUnauthorize
protected function handleUnauthorize(Connection $connection)
{
	$userId = $connection->getOwner()->getId();
	$oAuth = $this->prepareAuthEntity($userId);
	$userTokenInfo = $this->getStorageToken($userId);
	$refreshResult = false;
	
	if ($userTokenInfo['REFRESH_TOKEN'])
	{
		$refreshResult = $oAuth->getNewAccessToken($userTokenInfo['REFRESH_TOKEN'], $userId, true);
	}
	
	if (!$refreshResult)
	{
		$this->deactivateConnection();
	}
}