From 151ecf83e7f1686828f3a3cced6d231505ae76d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bispo?= Date: Thu, 16 Mar 2023 12:48:40 +0000 Subject: [PATCH] [PM-1431] [Defect] [Android] New accounts are not able to log in (#2417) * [PM-1431] Do not clear Master password if login is ongoing. --- src/App/Pages/Accounts/LoginPageViewModel.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/App/Pages/Accounts/LoginPageViewModel.cs b/src/App/Pages/Accounts/LoginPageViewModel.cs index be8ab4d99..3622c0338 100644 --- a/src/App/Pages/Accounts/LoginPageViewModel.cs +++ b/src/App/Pages/Accounts/LoginPageViewModel.cs @@ -40,6 +40,7 @@ namespace Bit.App.Pages private string _masterPassword; private bool _isEmailEnabled; private bool _isKnownDevice; + private bool _isExecutingLogin; public LoginPageViewModel() { @@ -192,6 +193,7 @@ namespace Bit.App.Pages ShowPassword = false; try { + _isExecutingLogin = true; if (checkForExistingAccount) { var userId = await _stateService.GetUserIdAsync(Email); @@ -253,14 +255,21 @@ namespace Bit.App.Pages AppResources.AnErrorHasOccurred, AppResources.Ok); } } + finally + { + _isExecutingLogin = false; + } } public void ResetPasswordField() { try { - MasterPassword = string.Empty; - ShowPassword = false; + if (!_isExecutingLogin) + { + MasterPassword = string.Empty; + ShowPassword = false; + } } catch (Exception ex) {