Skip to content

Commit

Permalink
Merge pull request #608 from credebl/verification-oob-issue
Browse files Browse the repository at this point in the history
fix: solved issue for oob verification with email
  • Loading branch information
KulkarniShashank authored Mar 26, 2024
2 parents c1b7a54 + dd1de6b commit 1059205
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
15 changes: 2 additions & 13 deletions apps/verification/src/verification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -428,15 +428,9 @@ export class VerificationService {
}


private async generateOOBProofReq(payload: IProofRequestPayload, getAgentDetails: org_agents): Promise<object> {
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<object> {
const getProofPresentation = await this._sendOutOfBandProofRequest(payload);


if (!getProofPresentation) {
throw new Error(ResponseMessages.verification.error.proofPresentationNotFound);
}
Expand Down Expand Up @@ -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<boolean> {
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) {
Expand Down
3 changes: 0 additions & 3 deletions libs/common/src/common.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 1059205

Please sign in to comment.