Merge pull request #48 from dyc3/update-setup-process
update setup process
This commit is contained in:
commit
6ffdb3ddc7
3 changed files with 35 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,5 +3,6 @@ bin/
|
|||
obj/
|
||||
.idea/
|
||||
SteamAuth/SteamAuth/packages/
|
||||
test_maFiles/
|
||||
|
||||
*.deb
|
45
Program.cs
45
Program.cs
|
@ -364,29 +364,40 @@ namespace SteamGuard
|
|||
var password = Utils.ReadLineSecure();
|
||||
|
||||
UserLogin login = new UserLogin(username, password);
|
||||
string emailCode = null, twoFactorCode = null;
|
||||
while (true)
|
||||
LoginResult loginResult;
|
||||
do
|
||||
{
|
||||
login.EmailCode = emailCode;
|
||||
login.TwoFactorCode = twoFactorCode;
|
||||
Console.Write($"Logging in {username}... ");
|
||||
LoginResult loginResult = login.DoLogin();
|
||||
loginResult = login.DoLogin();
|
||||
Console.WriteLine(loginResult);
|
||||
if (loginResult == LoginResult.NeedEmail)
|
||||
switch (loginResult)
|
||||
{
|
||||
case LoginResult.NeedEmail:
|
||||
Console.Write("Email code: ");
|
||||
emailCode = Console.ReadLine();
|
||||
continue;
|
||||
}
|
||||
else if (loginResult == LoginResult.Need2FA)
|
||||
{
|
||||
login.EmailCode = Console.ReadLine();
|
||||
break;
|
||||
case LoginResult.Need2FA:
|
||||
Console.Write("2FA code: ");
|
||||
twoFactorCode = Console.ReadLine();
|
||||
continue;
|
||||
}
|
||||
if (!login.LoggedIn) return;
|
||||
login.TwoFactorCode = Console.ReadLine();
|
||||
break;
|
||||
case LoginResult.NeedCaptcha:
|
||||
Console.WriteLine($"Please open: https://steamcommunity.com/public/captcha.php?gid={login.CaptchaGID}");
|
||||
Console.Write("Captcha text: ");
|
||||
login.CaptchaText = Console.ReadLine();
|
||||
break;
|
||||
case LoginResult.BadCredentials:
|
||||
Console.WriteLine("error: Bad Credentials");
|
||||
return;
|
||||
case LoginResult.TooManyFailedLogins:
|
||||
Console.WriteLine("error: Too many failed logins. Wait a bit before trying again.");
|
||||
return;
|
||||
case LoginResult.LoginOkay:
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine($"Unknown login result: {loginResult}");
|
||||
break;
|
||||
}
|
||||
} while (loginResult != LoginResult.LoginOkay);
|
||||
|
||||
AuthenticatorLinker linker = new AuthenticatorLinker(login.Session);
|
||||
AuthenticatorLinker.LinkResult linkResult = AuthenticatorLinker.LinkResult.GeneralFailure;
|
||||
|
@ -407,6 +418,10 @@ namespace SteamGuard
|
|||
linker.PhoneNumber = phonenumber;
|
||||
} while (!PhoneNumberOkay(phonenumber));
|
||||
break;
|
||||
case AuthenticatorLinker.LinkResult.MustConfirmEmail:
|
||||
Console.WriteLine("Check your email. Before continuing, click the link in the email to confirm your phone number. Press enter to continue...");
|
||||
Console.ReadLine();
|
||||
break;
|
||||
case AuthenticatorLinker.LinkResult.MustRemovePhoneNumber:
|
||||
linker.PhoneNumber = null;
|
||||
break;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 2f9f8b92cd365414196b90cae3ab25ff430a4fab
|
||||
Subproject commit e0619528fbe8f4c6f74135283b3f991219e73cf4
|
Loading…
Reference in a new issue