Skip to content

Commit

Permalink
Add the credentialStatus to the verify result
Browse files Browse the repository at this point in the history
  • Loading branch information
jasny committed Jul 28, 2023
1 parent 745c263 commit 10072d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lto-credential-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export class LtoCredentialPlugin implements IAgentPlugin {
) {
return {
verified: false,
credentialStatus: status,
error: {
message:
'issue_statement_elapsed: The on-chain statement has been published more than 5 minutes after the credential was issued',
Expand All @@ -214,6 +215,7 @@ export class LtoCredentialPlugin implements IAgentPlugin {
if (status.suspendedAt) {
return {
verified: false,
credentialStatus: status,
error: {
message: 'suspended: The credential was suspended by the issuer',
errorCode: 'suspended',
Expand All @@ -224,13 +226,15 @@ export class LtoCredentialPlugin implements IAgentPlugin {
if (status.revokedAt) {
return {
verified: false,
credentialStatus: status,
error: {
message: 'revoked: The credential was revoked by the issuer',
errorCode: 'revoked',
},
};
}

result.credentialStatus = status;
return result;
}

Expand Down

0 comments on commit 10072d8

Please sign in to comment.