From ff3c27350e9d05b3dffcb269238933e84553a00a Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Tue, 12 Aug 2025 14:02:49 +0530 Subject: [PATCH 1/2] fix: agent auth issue due to incorrect token (#1388) Signed-off-by: Krishna Waske --- apps/agent-service/src/agent-service.service.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/agent-service/src/agent-service.service.ts b/apps/agent-service/src/agent-service.service.ts index ae092b204..b844083cd 100644 --- a/apps/agent-service/src/agent-service.service.ts +++ b/apps/agent-service/src/agent-service.service.ts @@ -1748,7 +1748,6 @@ export class AgentServiceService { throw new InternalServerErrorException(`Failed to get agent information: ${orgAgentResult.reason}`); } - const getApiKey = getApiKeyResult?.value; const orgAgent = orgAgentResult?.value; const orgAgentTypeResult = await this.agentServiceRepository.getOrgAgentType(orgAgent.orgAgentTypeId); @@ -1757,6 +1756,17 @@ export class AgentServiceService { throw new NotFoundException(ResponseMessages.agent.error.orgAgentNotFound); } + let getApiKey; + if (OrgAgentType.SHARED) { + const platformAdminSpinnedUp = await this.agentServiceRepository.platformAdminAgent( + CommonConstants.PLATFORM_ADMIN_ORG + ); + + getApiKey = await this.commonService.decryptPassword(platformAdminSpinnedUp?.org_agents[0].apiKey); + } else { + getApiKey = getApiKeyResult?.value; + } + // Determine the URL based on the agent type const url = orgAgentTypeResult.agent === OrgAgentType.SHARED From 4816fb6559e83be1eeae38cbeab6827fa50566dd Mon Sep 17 00:00:00 2001 From: Sujit Date: Wed, 13 Aug 2025 05:30:31 +0530 Subject: [PATCH 2/2] fix/all schema api Signed-off-by: Sujit --- apps/ledger/src/schema/schema.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ledger/src/schema/schema.service.ts b/apps/ledger/src/schema/schema.service.ts index f3f7bd5a2..1fd599611 100644 --- a/apps/ledger/src/schema/schema.service.ts +++ b/apps/ledger/src/schema/schema.service.ts @@ -649,7 +649,7 @@ export class SchemaService extends BaseService { const response = await this.schemaRepository.getAllSchemaDetails(schemaSearchCriteria); const schemasDetails = response?.schemasResult.map((schemaAttributeItem) => { const attributes = JSON.parse(schemaAttributeItem.attributes); - return { ...schemaAttributeItem, attributes, organizationName: schemaAttributeItem.organisation.name }; + return { ...schemaAttributeItem, attributes, organizationName: schemaAttributeItem.organisation?.name || '' }; }); const schemasResponse = {