mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
fix token, update setting
This commit is contained in:
1 parent
1074c21c00
commit
31622bc580
4 files changed
+35
-27
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user