mirror of
https://github.com/bitwarden/server.git
synced 2025-04-07 05:58:13 -05: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();
|
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);
|
await _cipherService.SaveDetailsAsync(model.ToCipherDetails(login), userId);
|
||||||
|
|
||||||
var response = new LoginResponseModel(login);
|
var response = new LoginResponseModel(login);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user