Read any non-empty input when prompting for an input like 2fa code or auth code

pull/319/head
Ryan Kistner 4 years ago
parent 48e8267e28
commit 73d46d7774

@ -243,7 +243,7 @@ namespace DepotDownloader
if (node_encrypted != KeyValue.Invalid) if (node_encrypted != KeyValue.Invalid)
{ {
var password = Config.BetaPassword; var password = Config.BetaPassword;
if (password == null) while (string.IsNullOrEmpty(password))
{ {
Console.Write("Please enter the password for branch {0}: ", branch); Console.Write("Please enter the password for branch {0}: ", branch);
Config.BetaPassword = password = Console.ReadLine(); Config.BetaPassword = password = Console.ReadLine();

@ -284,7 +284,7 @@ namespace DepotDownloader
} }
Console.WriteLine(); Console.WriteLine();
} while (String.Empty == password); } while (string.Empty == password);
} }
else if (username == null) else if (username == null)
{ {

@ -597,9 +597,12 @@ namespace DepotDownloader
} }
if (is2FA) if (is2FA)
{
do
{ {
Console.Write("Please enter your 2 factor auth code from your authenticator app: "); Console.Write("Please enter your 2 factor auth code from your authenticator app: ");
logonDetails.TwoFactorCode = Console.ReadLine(); logonDetails.TwoFactorCode = Console.ReadLine();
} while (String.Empty == logonDetails.TwoFactorCode);
} }
else if (isLoginKey) else if (isLoginKey)
{ {
@ -620,9 +623,12 @@ namespace DepotDownloader
} }
} }
else else
{
do
{ {
Console.Write("Please enter the authentication code sent to your email address: "); Console.Write("Please enter the authentication code sent to your email address: ");
logonDetails.AuthCode = Console.ReadLine(); logonDetails.AuthCode = Console.ReadLine();
} while (string.Empty == logonDetails.AuthCode);
} }
Console.Write("Retrying Steam3 connection..."); Console.Write("Retrying Steam3 connection...");

Loading…
Cancel
Save