Skip to content

Commit

Permalink
fixed relogin
Browse files Browse the repository at this point in the history
fixed relogin
  • Loading branch information
MakcStudio committed Oct 19, 2023
1 parent 1c72a2c commit 4d9d722
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions Steam Desktop Authenticator/LoginForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void btnSteamLogin_Click(object sender, EventArgs e)

if (LoginReason == LoginType.Android)
{
FinishExtract(username, password);
//FinishExtract(username, password);
return;
}
else if (LoginReason == LoginType.Refresh)
Expand Down Expand Up @@ -321,10 +321,22 @@ private async void RefreshLogin(string username, string password)

LoginResult response = LoginResult.BadCredentials;

while ((response = mUserLogin.DoLogin()) != LoginResult.LoginOkay)
while ((response = mUserLogin.DoLoginV2()) != LoginResult.LoginOkay)
{
switch (response)
{
case LoginResult.NeedEmail:
InputForm emailForm = new InputForm("Ââåäèòå êîä, îòïðàâëåííûé íà âàø email:");
emailForm.ShowDialog();
if (emailForm.Canceled)
{
this.Close();
return;
}

mUserLogin.EmailCode = emailForm.txtBox.Text;
break;

case LoginResult.NeedCaptcha:
CaptchaForm captchaForm = new CaptchaForm(mUserLogin.CaptchaGID);
captchaForm.ShowDialog();
Expand Down Expand Up @@ -363,6 +375,48 @@ private async void RefreshLogin(string username, string password)
}
}

/*while ((response = mUserLogin.DoLogin()) != LoginResult.LoginOkay)
{
switch (response)
{
case LoginResult.NeedCaptcha:
CaptchaForm captchaForm = new CaptchaForm(mUserLogin.CaptchaGID);
captchaForm.ShowDialog();
if (captchaForm.Canceled)
{
this.Close();
return;
}
mUserLogin.CaptchaText = captchaForm.CaptchaCode;
break;
case LoginResult.Need2FA:
mUserLogin.TwoFactorCode = androidAccount.GenerateSteamGuardCodeForTime(steamTime);
break;
case LoginResult.BadRSA:
MessageBox.Show("Error logging in: Steam âåðíóë \"BadRSA\".", "Îøèáêà âõîäà", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
return;
case LoginResult.BadCredentials:
MessageBox.Show("Error logging in: Username or password íåêîððåêòíûå.", "Îøèáêà âõîäà", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
return;
case LoginResult.TooManyFailedLogins:
MessageBox.Show("Error logging in: Ñëèøêîì ìíîãî íåóäà÷íûõ ïîïûòîê, ïîïðîáóéòå ïîçæå.", "Îøèáêà âõîäà", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
return;
case LoginResult.GeneralFailure:
MessageBox.Show("Error logging in: Steam âåðíóë \"GeneralFailure\".", "Îøèáêà âõîäà", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
return;
}
}*/

androidAccount.Session = mUserLogin.Session;

HandleManifest(man, true);
Expand Down

0 comments on commit 4d9d722

Please sign in to comment.