Skip to content

Commit

Permalink
Merge pull request #38 from lowdefy/fix-mdb-auth-adapter
Browse files Browse the repository at this point in the history
fix: Fix MultiAppMongoDBAdapter for mongodb v6 driver.
  • Loading branch information
SamTolmay authored Dec 7, 2023
2 parents 02af5b7 + b864c10 commit c234a4e
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 c234a4e

Please sign in to comment.