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)
{
var password = Config.BetaPassword;
if (password == null)
while (string.IsNullOrEmpty(password))
{
Console.Write("Please enter the password for branch {0}: ", branch);
Config.BetaPassword = password = Console.ReadLine();

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

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

Loading…
Cancel
Save