From bd88fe11129288ced251aeb8e3412fa26df0860d Mon Sep 17 00:00:00 2001 From: Sergey Kolupaev Date: Tue, 29 Oct 2024 11:00:15 -0700 Subject: [PATCH] Powershell ignores password property of the configuration file --- Cli/Utils.cs | 9 --------- Commander/NotConnectedCommands.cs | 7 ------- KeeperSdk/auth/AuthSync.cs | 5 +++++ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Cli/Utils.cs b/Cli/Utils.cs index 64e809c..2a3397c 100644 --- a/Cli/Utils.cs +++ b/Cli/Utils.cs @@ -90,15 +90,6 @@ public static async Task LoginToKeeper(AuthSync auth, IInputManager inputManager passwds.AddRange(passwords); } - var uc = auth.Storage.Users.Get(email); - if (!string.IsNullOrEmpty(uc?.Password)) - { - if (!passwds.Contains(uc.Password)) - { - passwds.Add(uc.Password); - } - } - await auth.Login(email, passwds.ToArray()); if (!auth.IsCompleted) { diff --git a/Commander/NotConnectedCommands.cs b/Commander/NotConnectedCommands.cs index 90117c1..80e3a44 100644 --- a/Commander/NotConnectedCommands.cs +++ b/Commander/NotConnectedCommands.cs @@ -305,13 +305,6 @@ private async Task DoLogin(LoginOptions options) { passwords.Add(options.Password); } - - var uc = _auth.Storage.Users.Get(username); - if (!string.IsNullOrEmpty(uc?.Password)) - { - passwords.Add(uc.Password); - } - await Utils.LoginToKeeper(_auth, Program.GetInputManager(), username, passwords.ToArray()); } diff --git a/KeeperSdk/auth/AuthSync.cs b/KeeperSdk/auth/AuthSync.cs index 770688e..4952751 100644 --- a/KeeperSdk/auth/AuthSync.cs +++ b/KeeperSdk/auth/AuthSync.cs @@ -151,6 +151,11 @@ public async Task Login(string username, params string[] passwords) if (string.IsNullOrEmpty(password)) continue; _loginContext.PasswordQueue.Enqueue(password); } + var uc = Storage.Users.Get(username); + if (!string.IsNullOrEmpty(uc?.Password)) + { + _loginContext.PasswordQueue.Enqueue(uc.Password); + } await DoLogin(username); }