Skip to content

Commit

Permalink
[EC-529] fix: null providerService
Browse files Browse the repository at this point in the history
  • Loading branch information
coroiu committed Sep 9, 2022
1 parent 8c766e8 commit cfa0443
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/Api/Controllers/CiphersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ public async Task<ListResponseModel<CipherMiniDetailsResponseModel>> GetOrganiza
var responses = orgCiphers.Select(c => new CipherMiniDetailsResponseModel(c, _globalSettings,
collectionCiphersGroupDict, c.OrganizationUseTotp));

var providerId = await _currentContext.ProviderIdForOrg(orgIdGuid);
if (providerId.HasValue)
{
await _providerService.LogProviderAccessToOrganizationAsync(orgIdGuid);
}

return new ListResponseModel<CipherMiniDetailsResponseModel>(responses);
}

Expand Down
7 changes: 0 additions & 7 deletions src/Core/Services/Implementations/CipherService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class CipherService : ICipherService
private const long _fileSizeLeeway = 1024L * 1024L; // 1MB
private readonly IReferenceEventService _referenceEventService;
private readonly ICurrentContext _currentContext;
private readonly IProviderService _providerService;

public CipherService(
ICipherRepository cipherRepository,
Expand Down Expand Up @@ -876,12 +875,6 @@ public async Task RestoreManyAsync(IEnumerable<CipherDetails> ciphers, Guid rest
.Where(c => orgCipherIds.Contains(c.CipherId))
.GroupBy(c => c.CipherId).ToDictionary(s => s.Key);

var providerId = await _currentContext.ProviderIdForOrg(organizationId);
if (providerId.HasValue)
{
await _providerService.LogProviderAccessToOrganizationAsync(organizationId);
}

return (orgCiphers, collectionCiphersGroupDict);
}

Expand Down

0 comments on commit cfa0443

Please sign in to comment.