From 22177f1fe7525b78593b75a43fdad366c37706dd Mon Sep 17 00:00:00 2001 From: Archi Date: Thu, 19 Oct 2023 14:36:05 +0200 Subject: [PATCH] Fix RefreshToken handling for existing setups --- ArchiSteamFarm/Steam/Bot.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ArchiSteamFarm/Steam/Bot.cs b/ArchiSteamFarm/Steam/Bot.cs index 725238e00dbfb..61be905ed3c2a 100644 --- a/ArchiSteamFarm/Steam/Bot.cs +++ b/ArchiSteamFarm/Steam/Bot.cs @@ -2177,8 +2177,8 @@ private async Task HandleLoginResult(EResult result, EResult extendedResult) { } break; - case EResult.AccessDenied when string.IsNullOrEmpty(BotDatabase.RefreshToken) && (++LoginFailures >= MaxLoginFailures): - case EResult.InvalidPassword when string.IsNullOrEmpty(BotDatabase.RefreshToken) && (++LoginFailures >= MaxLoginFailures): + case EResult.AccessDenied when string.IsNullOrEmpty(RefreshToken) && (++LoginFailures >= MaxLoginFailures): + case EResult.InvalidPassword when string.IsNullOrEmpty(RefreshToken) && (++LoginFailures >= MaxLoginFailures): LoginFailures = 0; ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.BotInvalidPasswordDuringLogin, MaxLoginFailures)); Stop(); @@ -2734,11 +2734,11 @@ private async void OnDisconnected(SteamClient.DisconnectedCallback callback) { case EResult.AccountDisabled: // Do not attempt to reconnect, those failures are permanent return; - case EResult.AccessDenied when !string.IsNullOrEmpty(BotDatabase.RefreshToken): - case EResult.Expired when !string.IsNullOrEmpty(BotDatabase.RefreshToken): - case EResult.InvalidPassword when !string.IsNullOrEmpty(BotDatabase.RefreshToken): + case EResult.AccessDenied when !string.IsNullOrEmpty(RefreshToken): + case EResult.Expired when !string.IsNullOrEmpty(RefreshToken): + case EResult.InvalidPassword when !string.IsNullOrEmpty(RefreshToken): // We can retry immediately - BotDatabase.RefreshToken = null; + BotDatabase.RefreshToken = RefreshToken = null; ArchiLogger.LogGenericInfo(Strings.BotRemovedExpiredLoginKey); break;