Skip to content

Commit

Permalink
Add hotfix for empty access token with EResult.OK
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Oct 20, 2023
1 parent aa1c344 commit 02312db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ArchiSteamFarm/Steam/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1555,10 +1555,12 @@ internal async Task<bool> RefreshWebSession(bool force = false) {

CAuthentication_AccessToken_GenerateForApp_Response? response = await ArchiHandler.GenerateAccessTokens(RefreshToken!).ConfigureAwait(false);

if (response == null) {
if (string.IsNullOrEmpty(response?.access_token)) {
// The request has failed, in almost all cases this means our refresh token is no longer valid, relog needed
BotDatabase.RefreshToken = RefreshToken = null;

ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, nameof(ArchiHandler.GenerateAccessTokens)));

await Connect(true).ConfigureAwait(false);

return false;
Expand Down

0 comments on commit 02312db

Please sign in to comment.