From dd1de6b11582f2dc1c5b786c5b99cc869adf02b6 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Thu, 21 Mar 2024 19:48:48 +0530 Subject: [PATCH] fix: solved issue for oob verification with email Signed-off-by: KulkarniShashank --- apps/verification/src/verification.service.ts | 15 ++------------- libs/common/src/common.service.ts | 3 --- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/apps/verification/src/verification.service.ts b/apps/verification/src/verification.service.ts index 9a4438dd3..ed5972689 100644 --- a/apps/verification/src/verification.service.ts +++ b/apps/verification/src/verification.service.ts @@ -399,7 +399,7 @@ export class VerificationService { await this.sendEmailInBatches(payload, emailId, getAgentDetails, getOrganization); return true; } else { - const presentationProof: IInvitation = await this.generateOOBProofReq(payload, getAgentDetails); + const presentationProof: IInvitation = await this.generateOOBProofReq(payload); const proofRequestInvitationUrl: string = presentationProof.invitationUrl; if (isShortenUrl) { const shortenedUrl: string = await this.storeVerificationObjectAndReturnUrl(proofRequestInvitationUrl, false); @@ -428,15 +428,9 @@ export class VerificationService { } - private async generateOOBProofReq(payload: IProofRequestPayload, getAgentDetails: org_agents): Promise { - let agentApiKey: string = await this.cacheService.get(CommonConstants.CACHE_APIKEY_KEY); - if (!agentApiKey || null === agentApiKey || undefined === agentApiKey) { - agentApiKey = await this._getOrgAgentApiKey(getAgentDetails.orgId); - } - payload.apiKey = agentApiKey; + private async generateOOBProofReq(payload: IProofRequestPayload): Promise { const getProofPresentation = await this._sendOutOfBandProofRequest(payload); - if (!getProofPresentation) { throw new Error(ResponseMessages.verification.error.proofPresentationNotFound); } @@ -473,11 +467,6 @@ export class VerificationService { // This function is specifically for OOB verification using email async sendOutOfBandProofRequest(payload: IProofRequestPayload, email: string, getAgentDetails: org_agents, organizationDetails: organisation): Promise { - let agentApiKey: string = await this.cacheService.get(CommonConstants.CACHE_APIKEY_KEY); - if (!agentApiKey || null === agentApiKey || undefined === agentApiKey) { - agentApiKey = await this._getOrgAgentApiKey(getAgentDetails.orgId); - } - payload.apiKey = agentApiKey; const getProofPresentation = await this._sendOutOfBandProofRequest(payload); if (!getProofPresentation) { diff --git a/libs/common/src/common.service.ts b/libs/common/src/common.service.ts index c88d28240..c290f1b2c 100644 --- a/libs/common/src/common.service.ts +++ b/libs/common/src/common.service.ts @@ -373,10 +373,7 @@ export class CommonService { process.env.CRYPTO_PRIVATE_KEY ); - this.logger.debug(`encryptedPassword ::: ${encryptedPassword}`); - this.logger.debug(`process.env.CRYPTO_PRIVATE_KEY ::: ${process.env.CRYPTO_PRIVATE_KEY}`); const decryptedPassword = JSON.parse(password.toString(CryptoJS.enc.Utf8)); - this.logger.debug(`decryptedPassword ::: ${decryptedPassword}`); return decryptedPassword; } catch (error) { throw new BadRequestException('Invalid Credentials');