public void RefreshToken(Func<string> code = null)
{
if (!string.IsNullOrWhiteSpace(_ap.Login) && !string.IsNullOrWhiteSpace(_ap.Password))
{
AuthorizeWithAntiCaptcha(
_ap.ApplicationId,
_ap.Login,
_ap.Password,
_ap.Settings,
code ?? _ap.TwoFactorAuthorization
);
}
else
{
throw new AggregateException(
"Невозможно обновить токен доступа т.к. последняя авторизация происходила не при помощи логина и пароля");
}
}