@bedrock/vc-verifier 21.2.0 → 21.2.1
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/challenges.js +4 -4
- package/package.json +1 -1
package/lib/challenges.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved.
|
|
2
|
+
* Copyright (c) 2022-2025 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import * as bedrock from '@bedrock/core';
|
|
5
5
|
import * as database from '@bedrock/mongodb';
|
|
@@ -110,7 +110,7 @@ async function _insert({challenge, ttl} = {}) {
|
|
|
110
110
|
assert.number(ttl, 'ttl');
|
|
111
111
|
challenge = _decodeChallenge({challenge});
|
|
112
112
|
|
|
113
|
-
// insert the configuration and
|
|
113
|
+
// insert the configuration and return the updated record
|
|
114
114
|
const now = Date.now();
|
|
115
115
|
const meta = {created: now, updated: now};
|
|
116
116
|
const expires = new Date(now + ttl);
|
|
@@ -124,8 +124,8 @@ async function _insert({challenge, ttl} = {}) {
|
|
|
124
124
|
};
|
|
125
125
|
try {
|
|
126
126
|
const collection = database.collections[COLLECTION_NAME];
|
|
127
|
-
|
|
128
|
-
return
|
|
127
|
+
await collection.insertOne(record);
|
|
128
|
+
return record;
|
|
129
129
|
} catch(e) {
|
|
130
130
|
if(!database.isDuplicateError(e)) {
|
|
131
131
|
throw e;
|