@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.
- package/lib/http.js +12 -8
- 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
|
-
//
|
|
156
|
-
// should be checked
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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 = {
|