Skip to content

Commit

Permalink
Merge pull request #340 from /issues/337-AccountPasswordChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
tpill90 authored Dec 26, 2023
2 parents eaf7dad + 6c856c2 commit 81b289a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions SteamPrefill/Handlers/Steam/Steam3Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,14 @@ private bool HandleLogonResult(SteamUser.LoggedOnCallback logonResult)
_logonDetails.Password = _ansiConsole.ReadPasswordAsync($"{Red("Invalid password! Please re-enter your password!")}").GetAwaiter().GetResult();
return false;
}

// User previously authenticated, but changed their password such that the previous access token is no longer valid.
if (loggedOn.Result == EResult.AccessDenied)
{
_ansiConsole.LogMarkupLine(Red("Steam password was changed! Current login token is no longer valid. Re-authentication is required..."));
_logonDetails.Password = _ansiConsole.ReadPasswordAsync($"{Red("Please enter your password!")}").GetAwaiter().GetResult();
_userAccountStore.AccessToken = null;
return false;
}
// SteamGuard code required
if (loggedOn.Result == EResult.AccountLogonDenied)
{
Expand All @@ -277,7 +284,7 @@ private bool HandleLogonResult(SteamUser.LoggedOnCallback logonResult)
throw new SteamLoginException($"Unable to login to Steam. An unknown error occurred : {loggedOn.Result}");
}

_ansiConsole.LogMarkupLine($"Logged into Steam");
_ansiConsole.LogMarkupLine("Logged into Steam");

// Forcing a garbage collect to remove stored password from memory
if (_logonDetails.Password != null)
Expand Down

0 comments on commit 81b289a

Please sign in to comment.