From 6c190f09182953bd5b3ce9d77d133064d6b1e804 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sun, 25 Dec 2016 19:29:58 -0500 Subject: [PATCH] added an automatic retry if LoginResult.Need2FA returned and account has shared secret --- Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Program.cs b/Program.cs index 4d01ca8..d78ab75 100644 --- a/Program.cs +++ b/Program.cs @@ -491,6 +491,14 @@ namespace SteamGuard UserLogin login = new UserLogin(username, password); Console.Write($"Logging in {username}... "); LoginResult loginResult = login.DoLogin(); + if (loginResult == LoginResult.Need2FA && !string.IsNullOrEmpty(account.SharedSecret)) + { + if (Verbose) Console.WriteLine(loginResult); + TimeAligner.AlignTime(); + login.TwoFactorCode = account.GenerateSteamGuardCode(); + if (Verbose) Console.Write($"Logging in {username}... "); + loginResult = login.DoLogin(); + } Console.WriteLine(loginResult); if (account.RefreshSession())