Skip to content

Commit

Permalink
fix: Fix decodeCredentialJWT function [DEV-3170] (#342)
Browse files Browse the repository at this point in the history
* Fix decodeCredentialJWT function.

* Removed assertion

---------

Co-authored-by: Tasos Derisiotis <[email protected]>
  • Loading branch information
abdulla-ashurov and Eengineer1 authored Sep 4, 2023
1 parent 6a37ffe commit c5330fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/agent/ICheqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4832,6 +4832,9 @@ export class Cheqd implements IAgentPlugin {
// validate credential payload vc property as VerifiableCredential
if (!decodedCredential.payload.vc) throw new Error('[did-provider-cheqd]: decode jwt: decodedCredential.payload.vc is required')

return decodedCredential.payload.vc satisfies VerifiableCredential
return {
...decodedCredential.payload.vc,
issuer: decodedCredential.payload.iss,
} satisfies VerifiableCredential
}
}

0 comments on commit c5330fb

Please sign in to comment.