diff --git a/.changeset/old-chicken-ring.md b/.changeset/old-chicken-ring.md new file mode 100644 index 0000000..ed9bb8b --- /dev/null +++ b/.changeset/old-chicken-ring.md @@ -0,0 +1,5 @@ +--- +'@lowdefy/community-plugin-mongodb': patch +--- + +Fix MultiAppMongoDBAdapter for mongodb v6 driver. diff --git a/plugins/community-plugin-mongodb/src/auth/adapters/MultiAppMongoDBAdapter/MultiAppMongoDBAdapter.js b/plugins/community-plugin-mongodb/src/auth/adapters/MultiAppMongoDBAdapter/MultiAppMongoDBAdapter.js index c7d9262..f17f884 100644 --- a/plugins/community-plugin-mongodb/src/auth/adapters/MultiAppMongoDBAdapter/MultiAppMongoDBAdapter.js +++ b/plugins/community-plugin-mongodb/src/auth/adapters/MultiAppMongoDBAdapter/MultiAppMongoDBAdapter.js @@ -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); @@ -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); }, @@ -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);