Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/controllers/credentials/CredentialController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export class CredentialController extends Controller {
messages: [credentialMessage],
autoAcceptConnection: true,
imageUrl: outOfBandOption?.imageUrl,
goalCode: outOfBandOption?.goalCode,
invitationDid,
})
return {
Expand All @@ -229,6 +230,8 @@ export class CredentialController extends Controller {
useDidSovPrefixWhereAllowed: this.agent.config.useDidSovPrefixWhereAllowed,
}),
outOfBandRecord: outOfBandRecord.toJSON(),
outOfBandRecordId: outOfBandRecord.id,
credentialRequestThId: offerOob.credentialRecord.threadId,
Comment thread
pranalidhanavade marked this conversation as resolved.
invitationDid: outOfBandOption?.invitationDid ? '' : invitationDid,
}
} catch (error) {
Expand Down
15 changes: 11 additions & 4 deletions src/events/CredentialEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,26 @@ export const credentialEvents = async (agent: Agent<RestMultiTenantAgentModules>
credentialData: null,
}

if (event.metadata.contextCorrelationId !== 'default' && record?.connectionId) {
if (event.metadata.contextCorrelationId !== 'default') {
await agent.modules.tenants.withTenantAgent(
{ tenantId: event.metadata.contextCorrelationId },
async (tenantAgent) => {
const connectionRecord = await tenantAgent.connections.findById(record.connectionId!)
if (record?.connectionId) {
const connectionRecord = await tenantAgent.connections.findById(record.connectionId!)
body.outOfBandId = connectionRecord?.outOfBandId
}
const data = await tenantAgent.credentials.getFormatData(record.id)
body.credentialData = data
body.outOfBandId = connectionRecord?.outOfBandId
}
)
}

if (event.metadata.contextCorrelationId === 'default') {
if (record?.connectionId) {
const connectionRecord = await agent.connections.findById(record.connectionId!)
body.outOfBandId = connectionRecord?.outOfBandId
}

const data = await agent.credentials.getFormatData(record.id)
body.credentialData = data
}
Expand All @@ -50,4 +57,4 @@ export const credentialEvents = async (agent: Agent<RestMultiTenantAgentModules>
})
}
})
}
}