Skip to content

Commit fad08a1

Browse files
committed
Fix linking new authenticator with null password
1 parent a180c10 commit fad08a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ArchiSteamFarm/Bot.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private void ImportAuthenticator(string maFilePath) {
485485
// But here we're dealing with WinAuth authenticator
486486
Logging.LogGenericInfo("ASF requires a few more steps to complete authenticator import...", BotName);
487487

488-
if (!InitializeLoginAndPassword()) {
488+
if (!InitializeLoginAndPassword(true)) {
489489
BotDatabase.SteamGuardAccount = null;
490490
return;
491491
}
@@ -1289,7 +1289,7 @@ private void LinkMobileAuthenticator() {
12891289

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

1292-
if (!InitializeLoginAndPassword()) {
1292+
if (!InitializeLoginAndPassword(true)) {
12931293
return;
12941294
}
12951295

@@ -1382,15 +1382,15 @@ private void JoinMasterChat() {
13821382
SteamFriends.JoinChat(BotConfig.SteamMasterClanID);
13831383
}
13841384

1385-
private bool InitializeLoginAndPassword() {
1385+
private bool InitializeLoginAndPassword(bool requiresPassword) {
13861386
if (string.IsNullOrEmpty(BotConfig.SteamLogin)) {
13871387
BotConfig.SteamLogin = Program.GetUserInput(Program.EUserInputType.Login, BotName);
13881388
if (string.IsNullOrEmpty(BotConfig.SteamLogin)) {
13891389
return false;
13901390
}
13911391
}
13921392

1393-
if (string.IsNullOrEmpty(BotConfig.SteamPassword) && string.IsNullOrEmpty(BotDatabase.LoginKey)) {
1393+
if (string.IsNullOrEmpty(BotConfig.SteamPassword) && (requiresPassword || string.IsNullOrEmpty(BotDatabase.LoginKey))) {
13941394
BotConfig.SteamPassword = Program.GetUserInput(Program.EUserInputType.Password, BotName);
13951395
if (string.IsNullOrEmpty(BotConfig.SteamPassword)) {
13961396
return false;
@@ -1428,7 +1428,7 @@ private void OnConnected(SteamClient.ConnectedCallback callback) {
14281428
}
14291429
}
14301430

1431-
if (!InitializeLoginAndPassword()) {
1431+
if (!InitializeLoginAndPassword(false)) {
14321432
Stop();
14331433
return;
14341434
}

0 commit comments

Comments
 (0)