1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-08 03:15:07 -05:00

[PM-5424] fix TDE provider user (#3771)

* Add Test Asserting Problem

* Fix Test

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
This commit is contained in:
Ike
2024-02-09 12:08:22 -08:00
committed by GitHub
parent de294b8299
commit a19ae0159f
2 changed files with 79 additions and 0 deletions

View File

@ -489,6 +489,10 @@ public class CurrentContext : ICurrentContext
{
if (Organizations == null)
{
// If we haven't had our user id set, take the one passed in since we are about to get information
// for them anyways.
UserId ??= userId;
var userOrgs = await organizationUserRepository.GetManyDetailsByUserAsync(userId);
Organizations = userOrgs.Where(ou => ou.Status == OrganizationUserStatusType.Confirmed)
.Select(ou => new CurrentContextOrganization(ou)).ToList();
@ -501,6 +505,10 @@ public class CurrentContext : ICurrentContext
{
if (Providers == null)
{
// If we haven't had our user id set, take the one passed in since we are about to get information
// for them anyways.
UserId ??= userId;
var userProviders = await providerUserRepository.GetManyByUserAsync(userId);
Providers = userProviders.Where(ou => ou.Status == ProviderUserStatusType.Confirmed)
.Select(ou => new CurrentContextProvider(ou)).ToList();