From b832b7c0ffcc3c095d2122fce3287328000faefd Mon Sep 17 00:00:00 2001 From: Simonas Karuzas Date: Mon, 30 Mar 2020 12:27:38 +0300 Subject: [PATCH] fix: Setting credentialSubject last --- packages/daf-w3c/src/message-validator.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/daf-w3c/src/message-validator.ts b/packages/daf-w3c/src/message-validator.ts index c3532afbd..06cd2b152 100644 --- a/packages/daf-w3c/src/message-validator.ts +++ b/packages/daf-w3c/src/message-validator.ts @@ -90,7 +90,6 @@ export class MessageValidator extends AbstractMessageValidator { vc.subject.did = payload.sub vc.raw = jwt - vc.credentialSubject = payload.vc.credentialSubject if (payload.nbf || payload.iat) { vc.issuanceDate = this.timestampToDate(payload.nbf || payload.iat) @@ -103,6 +102,8 @@ export class MessageValidator extends AbstractMessageValidator { vc.context = payload.vc['@context'] vc.type = payload.vc.type + vc.credentialSubject = payload.vc.credentialSubject + return vc }