Skip to content

Commit

Permalink
Kill old refresh token when getting Expired/Expired
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Oct 11, 2023
1 parent 5db85aa commit 324d208
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ArchiSteamFarm/Steam/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,7 @@ private async Task HandleLoginResult(EResult result, EResult extendedResult) {
case EResult.AccountLoginDeniedNeedTwoFactor:
case EResult.AccountLoginDeniedThrottle:
case EResult.DuplicateRequest: // This will happen if user reacts to popup and tries to use the code afterwards, we have the code saved in ASF, we just need to try again
case EResult.Expired: // Same as Timeout
case EResult.Expired: // Refresh token expired
case EResult.FileNotFound: // User denied approval despite telling us that he accepted it, just try again
case EResult.InvalidPassword:
case EResult.NoConnection:
Expand Down Expand Up @@ -2629,6 +2629,7 @@ private async void OnDisconnected(SteamClient.DisconnectedCallback callback) {
// 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):
// We can retry immediately
BotDatabase.RefreshToken = null;
Expand Down

0 comments on commit 324d208

Please sign in to comment.