1
0
mirror of https://github.com/bitwarden/mobile.git synced 2025-01-27 22:03:25 +01:00

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

* SG-1056 Fix login prompt loop for added accounts

* SG-1056 Fix PR comment
This commit is contained in:
Carlos Gonçalves 2023-02-10 17:49:05 +00:00 committed by GitHub
parent 5a56d64211
commit f42c677d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,16 +125,16 @@ namespace Bit.App.Pages
AppResources.Ok); AppResources.Ok);
return; return;
} }
await _stateService.SetRememberedEmailAsync(RememberEmail ? Email : null); await _stateService.SetRememberedEmailAsync(RememberEmail ? Email : null);
var userId = await _stateService.GetUserIdAsync(Email); 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); await _accountManager.PromptToSwitchToExistingAccountAsync(userId);
if (userEnvUrls?.Base == _environmentService.BaseUrl) return;
{
await _accountManager.PromptToSwitchToExistingAccountAsync(userId);
return;
}
} }
StartLoginAction(); StartLoginAction();
} }