fix token, update setting

This commit is contained in:
undefined committed 2020-07-01 22:25:50 +08:00
1 parent 1074c21c00
commit 31622bc580
4 files changed
+35 -27

No files matched your search

+2 -1
View File
@@ -53,7 +53,7 @@ async function get(tokenId, tokenType, doThrow = true) {
*/
async function update(tokenId, tokenType, expireSeconds, data) {
const now = new Date();
const res = await coll.updateOne(
const res = await coll.findOneAndUpdate(
{ _id: tokenId, tokenType },
{
$set: {
@@ -63,6 +63,7 @@ async function update(tokenId, tokenType, expireSeconds, data) {
tokenType,
},
},
{ returnOriginal: false },
);
return res.value;
}