diff --git a/src/Api/Controllers/LoginsController.cs b/src/Api/Controllers/LoginsController.cs index a7823e310..a8652ae67 100644 --- a/src/Api/Controllers/LoginsController.cs +++ b/src/Api/Controllers/LoginsController.cs @@ -117,6 +117,13 @@ namespace Bit.Api.Controllers throw new NotFoundException(); } + var modelOrgId = string.IsNullOrWhiteSpace(model.OrganizationId) ? (Guid?)null : new Guid(model.OrganizationId); + if(login.OrganizationId != modelOrgId) + { + throw new BadRequestException("Organization mismatch. Re-sync if you recently shared this login, " + + "then try again."); + } + await _cipherService.SaveDetailsAsync(model.ToCipherDetails(login), userId); var response = new LoginResponseModel(login);