Skip to content

Commit

Permalink
[SG-1056] Fix login prompt loop for added accounts (#2357)
Browse files Browse the repository at this point in the history
* SG-1056 Fix login prompt loop for added accounts

* SG-1056 Fix PR comment
  • Loading branch information
LRNcardozoWDF committed Feb 10, 2023
1 parent 5a56d64 commit f42c677
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/App/Pages/Accounts/HomePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ public async Task ContinueToLoginStepAsync()
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();
}
Expand Down

0 comments on commit f42c677

Please sign in to comment.