Skip to content

Commit

Permalink
Fix linking new authenticator with null password
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed May 12, 2016
1 parent a180c10 commit fad08a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ArchiSteamFarm/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private void ImportAuthenticator(string maFilePath) {
// But here we're dealing with WinAuth authenticator
Logging.LogGenericInfo("ASF requires a few more steps to complete authenticator import...", BotName);

if (!InitializeLoginAndPassword()) {
if (!InitializeLoginAndPassword(true)) {
BotDatabase.SteamGuardAccount = null;
return;
}
Expand Down Expand Up @@ -1289,7 +1289,7 @@ private void LinkMobileAuthenticator() {

Logging.LogGenericInfo("Linking new ASF MobileAuthenticator...", BotName);

if (!InitializeLoginAndPassword()) {
if (!InitializeLoginAndPassword(true)) {
return;
}

Expand Down Expand Up @@ -1382,15 +1382,15 @@ private void JoinMasterChat() {
SteamFriends.JoinChat(BotConfig.SteamMasterClanID);
}

private bool InitializeLoginAndPassword() {
private bool InitializeLoginAndPassword(bool requiresPassword) {
if (string.IsNullOrEmpty(BotConfig.SteamLogin)) {
BotConfig.SteamLogin = Program.GetUserInput(Program.EUserInputType.Login, BotName);
if (string.IsNullOrEmpty(BotConfig.SteamLogin)) {
return false;
}
}

if (string.IsNullOrEmpty(BotConfig.SteamPassword) && string.IsNullOrEmpty(BotDatabase.LoginKey)) {
if (string.IsNullOrEmpty(BotConfig.SteamPassword) && (requiresPassword || string.IsNullOrEmpty(BotDatabase.LoginKey))) {
BotConfig.SteamPassword = Program.GetUserInput(Program.EUserInputType.Password, BotName);
if (string.IsNullOrEmpty(BotConfig.SteamPassword)) {
return false;
Expand Down Expand Up @@ -1428,7 +1428,7 @@ private void OnConnected(SteamClient.ConnectedCallback callback) {
}
}

if (!InitializeLoginAndPassword()) {
if (!InitializeLoginAndPassword(false)) {
Stop();
return;
}
Expand Down

0 comments on commit fad08a1

Please sign in to comment.