From f42c677d5a4b5f5246cfa8b09fd463a1ef2746b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Gon=C3=A7alves?= Date: Fri, 10 Feb 2023 17:49:05 +0000 Subject: [PATCH] [SG-1056] Fix login prompt loop for added accounts (#2357) * SG-1056 Fix login prompt loop for added accounts * SG-1056 Fix PR comment --- src/App/Pages/Accounts/HomePageViewModel.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App/Pages/Accounts/HomePageViewModel.cs b/src/App/Pages/Accounts/HomePageViewModel.cs index 17286384e..d8a962141 100644 --- a/src/App/Pages/Accounts/HomePageViewModel.cs +++ b/src/App/Pages/Accounts/HomePageViewModel.cs @@ -125,16 +125,16 @@ namespace Bit.App.Pages AppResources.Ok); return; } + await _stateService.SetRememberedEmailAsync(RememberEmail ? Email : null); var userId = await _stateService.GetUserIdAsync(Email); - if (!string.IsNullOrWhiteSpace(userId)) + + if (!string.IsNullOrWhiteSpace(userId) && + (await _stateService.GetEnvironmentUrlsAsync(userId))?.Base == _environmentService.BaseUrl && + await _stateService.IsAuthenticatedAsync(userId)) { - var userEnvUrls = await _stateService.GetEnvironmentUrlsAsync(userId); - if (userEnvUrls?.Base == _environmentService.BaseUrl) - { - await _accountManager.PromptToSwitchToExistingAccountAsync(userId); - return; - } + await _accountManager.PromptToSwitchToExistingAccountAsync(userId); + return; } StartLoginAction(); }