Merge pull request #48 from dyc3/update-setup-process

update setup process
This commit is contained in:
Carson McManus 2020-10-12 14:26:47 -04:00 committed by GitHub
commit 6ffdb3ddc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 19 deletions

1
.gitignore vendored
View file

@ -3,5 +3,6 @@ bin/
obj/
.idea/
SteamAuth/SteamAuth/packages/
test_maFiles/
*.deb

View file

@ -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)
{
Console.Write("Email code: ");
emailCode = Console.ReadLine();
continue;
case LoginResult.NeedEmail:
Console.Write("Email code: ");
login.EmailCode = Console.ReadLine();
break;
case LoginResult.Need2FA:
Console.Write("2FA code: ");
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;
}
else if (loginResult == LoginResult.Need2FA)
{
Console.Write("2FA code: ");
twoFactorCode = Console.ReadLine();
continue;
}
if (!login.LoggedIn) return;
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