Browse Source

[SG-1056] Fix login prompt loop for added accounts (#2357)

* SG-1056 Fix login prompt loop for added accounts

* SG-1056 Fix PR comment
github-services/pull/2371/head
Carlos Gonçalves 3 years ago committed by GitHub
parent
commit
f42c677d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/App/Pages/Accounts/HomePageViewModel.cs

14
src/App/Pages/Accounts/HomePageViewModel.cs

@ -125,16 +125,16 @@ namespace Bit.App.Pages @@ -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();
}

Loading…
Cancel
Save