mirror of
https://github.com/bitwarden/server.git
synced 2024-12-23 17:07:42 +01:00
add check for org id mismatch
This commit is contained in:
parent
d9c67ffeff
commit
d7040b9ab6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user