diff --git a/src/lib/services/OpenID4VCIClient.ts b/src/lib/services/OpenID4VCIClient.ts index 12f80607f..6e18e1e8c 100644 --- a/src/lib/services/OpenID4VCIClient.ts +++ b/src/lib/services/OpenID4VCIClient.ts @@ -405,11 +405,11 @@ export class OpenID4VCIClient implements IOpenID4VCIClient { audience: this.config.credentialIssuerIdentifier }) } - const generateProofsResult = cachedProofs ? { proof_jwts: cachedProofs } : await this.generateNonceProofs(inputs); - proofsArray = generateProofsResult.proof_jwts; - if (proofsArray) { + const generateProofsResult = cachedProofs ? { proof_jwts: cachedProofs } : await this.generateNonceProofs(inputs).then((res) => { dispatchEvent(new CustomEvent("generatedProof")); - } + return res; + }); + proofsArray = generateProofsResult.proof_jwts; } catch (err) { console.error(err);