From 1ce2a097df55842aee9c8753754d4b34339dc952 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 5 Oct 2015 01:12:43 +0300 Subject: [PATCH] Add 2FA support --- DepotDownloader/Steam3Session.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/DepotDownloader/Steam3Session.cs b/DepotDownloader/Steam3Session.cs index 8918d930..504a63df 100644 --- a/DepotDownloader/Steam3Session.cs +++ b/DepotDownloader/Steam3Session.cs @@ -382,14 +382,25 @@ namespace DepotDownloader private void LogOnCallback(SteamUser.LoggedOnCallback loggedOn) { - if (loggedOn.Result == EResult.AccountLogonDenied) + bool isSteamGuard = loggedOn.Result == EResult.AccountLogonDenied; + bool is2FA = loggedOn.Result == EResult.AccountLoginDeniedNeedTwoFactor; + + if (isSteamGuard || is2FA) { - Console.WriteLine("This account is protected by Steam Guard. Please enter the authentication code sent to your email address."); - Console.Write("Auth Code: "); + Console.WriteLine("This account is protected by Steam Guard."); Abort(false); - logonDetails.AuthCode = Console.ReadLine(); + if (is2FA) + { + Console.Write("Please enter your 2 factor auth code from your authenticator app: "); + logonDetails.TwoFactorCode = Console.ReadLine(); + } + else + { + Console.Write("Please enter the authentication code sent to your email address: "); + logonDetails.AuthCode = Console.ReadLine(); + } Console.Write("Retrying Steam3 connection..."); Connect();