diff --git a/src/Api/Controllers/SyncController.cs b/src/Api/Controllers/SyncController.cs index 6153cae09..7f3ce3c04 100644 --- a/src/Api/Controllers/SyncController.cs +++ b/src/Api/Controllers/SyncController.cs @@ -46,7 +46,7 @@ namespace Bit.Api.Controllers } [HttpGet("")] - public async Task Get() + public async Task Get([FromQuery]bool excludeDomains = false) { var user = await _userService.GetUserByPrincipalAsync(User); if(user == null) @@ -70,7 +70,7 @@ namespace Bit.Api.Controllers } var response = new SyncResponseModel(_globalSettings, user, organizationUserDetails, folders, - collections, ciphers, collectionCiphersGroupDict); + collections, ciphers, collectionCiphersGroupDict, excludeDomains); return response; } } diff --git a/src/Core/Models/Api/Response/SyncResponseModel.cs b/src/Core/Models/Api/Response/SyncResponseModel.cs index 6bd3103ed..38e80caf5 100644 --- a/src/Core/Models/Api/Response/SyncResponseModel.cs +++ b/src/Core/Models/Api/Response/SyncResponseModel.cs @@ -16,7 +16,8 @@ namespace Bit.Core.Models.Api IEnumerable folders, IEnumerable collections, IEnumerable ciphers, - IDictionary> collectionCiphersDict) + IDictionary> collectionCiphersDict, + bool excludeDomains) : base("sync") { Profile = new ProfileResponseModel(user, organizationUserDetails); @@ -24,7 +25,7 @@ namespace Bit.Core.Models.Api Ciphers = ciphers.Select(c => new CipherDetailsResponseModel(c, globalSettings, collectionCiphersDict)); Collections = collections?.Select( c => new CollectionDetailsResponseModel(c)) ?? new List(); - Domains = new DomainsResponseModel(user, false); + Domains = excludeDomains ? null : new DomainsResponseModel(user, false); } public ProfileResponseModel Profile { get; set; }