diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index da5124e1f..195515e08 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -239,7 +239,7 @@ namespace ArchiSteamFarm { internal async Task GetConfirmations(string deviceID, string confirmationHash, uint time) { if (string.IsNullOrEmpty(deviceID) || string.IsNullOrEmpty(confirmationHash) || (time == 0)) { - Logging.LogNullError(nameof(deviceID) + " || " + nameof(confirmationHash) + " || " + nameof(time)); + Logging.LogNullError(nameof(deviceID) + " || " + nameof(confirmationHash) + " || " + nameof(time), Bot.BotName); return null; } @@ -257,6 +257,10 @@ namespace ArchiSteamFarm { return null; } + if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { + return null; + } + string request = SteamCommunityURL + "/mobileconf/details/" + confirmationID + "?p=" + deviceID + "&a=" + SteamID + "&k=" + WebUtility.UrlEncode(confirmationHash) + "&t=" + time + "&m=android&tag=conf"; string json = await WebBrowser.UrlGetToContentRetry(request).ConfigureAwait(false); @@ -287,6 +291,10 @@ namespace ArchiSteamFarm { return false; } + if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { + return false; + } + string request = SteamCommunityURL + "/mobileconf/ajaxop?op=" + (accept ? "allow" : "cancel") + "&p=" + deviceID + "&a=" + SteamID + "&k=" + WebUtility.UrlEncode(confirmationHash) + "&t=" + time + "&m=android&tag=conf&cid=" + confirmationID + "&ck=" + confirmationKey; string json = await WebBrowser.UrlGetToContentRetry(request).ConfigureAwait(false); @@ -398,7 +406,7 @@ namespace ArchiSteamFarm { internal uint GetServerTime() { KeyValue response = null; - using (dynamic iTwoFactorService = WebAPI.GetInterface("ITwoFactorService", Bot.BotConfig.SteamApiKey)) { + using (dynamic iTwoFactorService = WebAPI.GetInterface("ITwoFactorService")) { iTwoFactorService.Timeout = Timeout; for (byte i = 0; (i < WebBrowser.MaxRetries) && (response == null); i++) {