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/
|
obj/
|
||||||
.idea/
|
.idea/
|
||||||
SteamAuth/SteamAuth/packages/
|
SteamAuth/SteamAuth/packages/
|
||||||
|
test_maFiles/
|
||||||
|
|
||||||
*.deb
|
*.deb
|
45
Program.cs
45
Program.cs
|
@ -364,29 +364,40 @@ namespace SteamGuard
|
||||||
var password = Utils.ReadLineSecure();
|
var password = Utils.ReadLineSecure();
|
||||||
|
|
||||||
UserLogin login = new UserLogin(username, password);
|
UserLogin login = new UserLogin(username, password);
|
||||||
string emailCode = null, twoFactorCode = null;
|
LoginResult loginResult;
|
||||||
while (true)
|
do
|
||||||
{
|
{
|
||||||
login.EmailCode = emailCode;
|
|
||||||
login.TwoFactorCode = twoFactorCode;
|
|
||||||
Console.Write($"Logging in {username}... ");
|
Console.Write($"Logging in {username}... ");
|
||||||
LoginResult loginResult = login.DoLogin();
|
loginResult = login.DoLogin();
|
||||||
Console.WriteLine(loginResult);
|
Console.WriteLine(loginResult);
|
||||||
if (loginResult == LoginResult.NeedEmail)
|
switch (loginResult)
|
||||||
{
|
{
|
||||||
|
case LoginResult.NeedEmail:
|
||||||
Console.Write("Email code: ");
|
Console.Write("Email code: ");
|
||||||
emailCode = Console.ReadLine();
|
login.EmailCode = Console.ReadLine();
|
||||||
continue;
|
break;
|
||||||
}
|
case LoginResult.Need2FA:
|
||||||
else if (loginResult == LoginResult.Need2FA)
|
|
||||||
{
|
|
||||||
Console.Write("2FA code: ");
|
Console.Write("2FA code: ");
|
||||||
twoFactorCode = Console.ReadLine();
|
login.TwoFactorCode = Console.ReadLine();
|
||||||
continue;
|
break;
|
||||||
}
|
case LoginResult.NeedCaptcha:
|
||||||
if (!login.LoggedIn) return;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
} while (loginResult != LoginResult.LoginOkay);
|
||||||
|
|
||||||
AuthenticatorLinker linker = new AuthenticatorLinker(login.Session);
|
AuthenticatorLinker linker = new AuthenticatorLinker(login.Session);
|
||||||
AuthenticatorLinker.LinkResult linkResult = AuthenticatorLinker.LinkResult.GeneralFailure;
|
AuthenticatorLinker.LinkResult linkResult = AuthenticatorLinker.LinkResult.GeneralFailure;
|
||||||
|
@ -407,6 +418,10 @@ namespace SteamGuard
|
||||||
linker.PhoneNumber = phonenumber;
|
linker.PhoneNumber = phonenumber;
|
||||||
} while (!PhoneNumberOkay(phonenumber));
|
} while (!PhoneNumberOkay(phonenumber));
|
||||||
break;
|
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:
|
case AuthenticatorLinker.LinkResult.MustRemovePhoneNumber:
|
||||||
linker.PhoneNumber = null;
|
linker.PhoneNumber = null;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2f9f8b92cd365414196b90cae3ab25ff430a4fab
|
Subproject commit e0619528fbe8f4c6f74135283b3f991219e73cf4
|
Loading…
Reference in a new issue