• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/liveid.php
  • Класс: WindowsLiveLogin
  • Вызов: WindowsLiveLogin::refreshConsentToken2
function refreshConsentToken2($offers_string, $refreshtoken, $ru=null)
{
	$body = $this->fetch($this->getRefreshConsentTokenUrl($offers_string, $refreshtoken, $ru));
	if (!$body) {
		$this->debug("Error: refreshConsentToken2: Failed to obtain a new token.");
		return;
	}

	preg_match('/{"ConsentToken":"(.*)"}/', $body, $matches);
	if(count($matches) == 2) {
		return $matches[1];
	}
	else {
		$this->debug("Error: refreshConsentToken2: Failed to extract token: $body");
		return;
	}
}