Skip to content

Commit

Permalink
Merge pull request #1735 from Crown-Commercial-Service/release/pre
Browse files Browse the repository at this point in the history
Use SSO field to validate the user for merged accounts.
  • Loading branch information
SamThomasJ authored Jun 10, 2024
2 parents 9ea1ae2 + 2137c5a commit b5a479a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ private CaTMessageOCDSAllOfAuthor getAuthorDetails(
.resolveBuyerUserByUserId(String.valueOf(message.getSenderUser().getId()))
.orElseThrow(() -> new ResourceNotFoundException(
String.format("Jaggaer user not found for %s", message.getSenderUser().getId())));
var conclaveUser = conclaveService.getUserProfile(jaggaerUser.getEmail())
.orElseThrow(() -> new ResourceNotFoundException("Conclave"));
Optional<SSOCodeData.SSOCode> ssoCode = jaggaerUser.getSsoCodeData().getSsoCode().stream().findFirst();
var conclaveUser = conclaveService.getUserProfile(ssoCode.isPresent()
&& Objects.nonNull(ssoCode.get().getSsoUserLogin())
? ssoCode.get().getSsoUserLogin() : jaggaerUser.getEmail())
.orElseThrow(() -> new ResourceNotFoundException("Conclave"));
var conclaveOrg = conclaveService.getOrganisationIdentity(conclaveUser.getOrganisationId())
.orElseThrow(() -> new ResourceNotFoundException(
format(ERR_MSG_FMT_CONCLAVE_USER_ORG_MISSING, conclaveUser.getOrganisationId())));
Expand Down

0 comments on commit b5a479a

Please sign in to comment.