@bedrock/vc-verifier 13.0.1 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/http.js +12 -8
  2. package/package.json +1 -1
package/lib/http.js CHANGED
@@ -152,14 +152,18 @@ export async function addRoutes({app, service} = {}) {
152
152
  _validateChecks({checks});
153
153
  const unsignedPresentation = !checks.includes('proof');
154
154
 
155
- // FIXME: allow for `checks` to request whether or not the challenge
156
- // should be checked; for now, default to checking it
157
-
158
- // first, check the challenge
159
- const {verified, uses: challengeUses, error} = await verifyChallenge(
160
- {challenge, verifierId: config.id});
161
- if(!verified) {
162
- throw error;
155
+ // allow for `checks` to indicate whether or not the challenge
156
+ // should be checked
157
+ let challengeUses;
158
+ if(checks.includes('challenge')) {
159
+ // first, check the challenge
160
+ const result = await verifyChallenge(
161
+ {challenge, verifierId: config.id});
162
+ const {verified, error} = result;
163
+ if(!verified) {
164
+ throw error;
165
+ }
166
+ ({uses: challengeUses} = result);
163
167
  }
164
168
 
165
169
  const verifyOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-verifier",
3
- "version": "13.0.1",
3
+ "version": "14.0.0",
4
4
  "type": "module",
5
5
  "description": "Bedrock VC Verifier",
6
6
  "main": "./lib/index.js",