• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/user.php
  • Класс: CAllUser
  • Вызов: CAllUser::AuthorizeWithOtp
public function AuthorizeWithOtp($user_id, $bSave = false)
{
	$doAuthorize = true;

	if (CModule::IncludeModule("security"))
	{
		/*
		MFA can allow or disallow authorization.
		Allowed only if:
		- OTP is not active for the user;
		When authorization is disallowed the OTP form will be shown on the next hit.
		*/
		$doAuthorize = BitrixSecurityMfaOtp::verifyUser(["USER_ID" => $user_id]);
	}

	if ($doAuthorize)
	{
		return $this->Authorize($user_id, $bSave);
	}

	return false;
}