Skip to content

Commit

Permalink
fix: Fix MultiAppMongoDBAdapter for mongodb v6 driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTolmay committed Dec 7, 2023
1 parent df1ea32 commit b864c10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-chicken-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-mongodb': patch
---

Fix MultiAppMongoDBAdapter for mongodb v6 driver.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function MultiAppMongoDBAdapter({ properties }) {
},

async unlinkAccount(provider_providerAccountId) {
const { value: account } = await mongoClient
const account = await mongoClient
.db()
.collection(collectionNames.accounts)
.findOneAndDelete(provider_providerAccountId);
Expand Down Expand Up @@ -118,16 +118,13 @@ function MultiAppMongoDBAdapter({ properties }) {
{ $set: session },
{ returnDocument: 'after' }
);
return from(result.value);
return from(result);
},

async deleteSession(sessionToken) {
const { value: session } = await mongoClient
.db()
.collection(collectionNames.sessions)
.findOneAndDelete({
sessionToken,
});
const session = await mongoClient.db().collection(collectionNames.sessions).findOneAndDelete({
sessionToken,
});
return from(session);
},

Expand All @@ -137,7 +134,7 @@ function MultiAppMongoDBAdapter({ properties }) {
},

async useVerificationToken(identifier_token) {
const { value: verificationToken } = await mongoClient
const verificationToken = await mongoClient
.db()
.collection(collectionNames.verificationTokens)
.findOneAndDelete(identifier_token);
Expand Down

0 comments on commit b864c10

Please sign in to comment.