Skip to content

VC is throwing exception instead of returning result when credential is expired #27

@fabrii

Description

@fabrii

When credential is revoked, vc returns the following object:

{"log": [{"id": "valid_signature", "valid": true},
{"id": "issuer_did_resolves", "valid": true},
{"id": "expiration", "valid": true},
{"id": "revocation_status", "valid": false}],
"results": [{"error": undefined, "log": [Array], "proof": [Object], "purposeResult": [Object], "verificationMethod": [Object], "verified": true}], "statusResult": {"results": [[Object]], "verified": false},
"verified": false}

When credential is expired, vc returns

{"error": [Error: Credential has expired.], "results": [{"credential": [Object], "error": [Error: Credential has expired.], "verified": false}], "verified": false}

VC should return a similar object as the first case with {"id": "expiration", "valid": false}
This has impact in learner credential: https://github.com/openwallet-foundation-labs/learner-credential-wallet/blob/8f9184309c770c015a63579bdb47d9d3ce5d4b93/app/lib/validate.ts#L83

When credential is expired, a generic Error is thrown, and the reason is lost.

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done (Deployed/Closed)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions