mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Change a bit the logic of ASF 2FA to handle GeneralFailures, closes #27
This commit is contained in:
@@ -195,20 +195,16 @@ namespace ArchiSteamFarm {
|
||||
|
||||
AuthenticatorLinker authenticatorLinker = new AuthenticatorLinker(userLogin.Session);
|
||||
|
||||
AuthenticatorLinker.LinkResult linkResult = authenticatorLinker.AddAuthenticator();
|
||||
switch (linkResult) {
|
||||
case AuthenticatorLinker.LinkResult.AwaitingFinalization:
|
||||
Logging.LogGenericInfo(BotName, "OK: " + linkResult);
|
||||
break;
|
||||
case AuthenticatorLinker.LinkResult.MustProvidePhoneNumber:
|
||||
while (linkResult == AuthenticatorLinker.LinkResult.MustProvidePhoneNumber) {
|
||||
AuthenticatorLinker.LinkResult linkResult;
|
||||
while ((linkResult = authenticatorLinker.AddAuthenticator()) != AuthenticatorLinker.LinkResult.AwaitingFinalization) {
|
||||
switch (linkResult) {
|
||||
case AuthenticatorLinker.LinkResult.MustProvidePhoneNumber:
|
||||
authenticatorLinker.PhoneNumber = Program.GetUserInput(BotName, Program.EUserInputType.PhoneNumber);
|
||||
linkResult = authenticatorLinker.AddAuthenticator();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Logging.LogGenericError(BotName, "Unhandled situation: " + linkResult);
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
Logging.LogGenericError(BotName, "Unhandled situation: " + linkResult);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SteamGuardAccount = authenticatorLinker.LinkedAccount;
|
||||
|
||||
Reference in New Issue
Block a user