Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export class V2CredentialProtocol<CFs extends CredentialFormatService[] = Creden
let credentialRecord = await this.findByProperties(messageContext.agentContext, {
threadId: proposalMessage.threadId,
role: CredentialRole.Issuer,
connectionId: connection?.id,
})

const formatServices = this.getFormatServicesFromMessage(proposalMessage.formats)
Expand Down Expand Up @@ -207,6 +206,15 @@ export class V2CredentialProtocol<CFs extends CredentialFormatService[] = Creden
expectedConnectionId: credentialRecord.connectionId,
})

// This makes sure that the sender of the incoming message is authorized to do so.
if (!credentialRecord?.connectionId) {
await connectionService.matchIncomingMessageToRequestMessageInOutOfBandExchange(messageContext, {
expectedConnectionId: credentialRecord?.connectionId,
})

credentialRecord.connectionId = connection?.id
}

await this.credentialFormatCoordinator.processProposal(messageContext.agentContext, {
credentialRecord,
formatServices,
Expand Down
Loading