Skip to content

Commit

Permalink
Fix RefreshToken handling for existing setups
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Oct 19, 2023
1 parent ab1edae commit 22177f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ArchiSteamFarm/Steam/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 22177f1

Please sign in to comment.