Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@auth/mongodb-adapter

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth/mongodb-adapter - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

17

index.js

@@ -163,3 +163,3 @@ /**

const result = await (await db).U.findOneAndUpdate({ _id }, { $set: user }, { returnDocument: "after" });
return from(result.value);
return from(result);
},

@@ -181,3 +181,3 @@ async deleteUser(id) {

async unlinkAccount(provider_providerAccountId) {
const { value: account } = await (await db).A.findOneAndDelete(provider_providerAccountId);
const account = await (await db).A.findOneAndDelete(provider_providerAccountId);
return from(account);

@@ -204,7 +204,7 @@ },

const { _id, ...session } = to(data);
const result = await (await db).S.findOneAndUpdate({ sessionToken: session.sessionToken }, { $set: session }, { returnDocument: "after" });
return from(result.value);
const updatedSession = await (await db).S.findOneAndUpdate({ sessionToken: session.sessionToken }, { $set: session }, { returnDocument: "after" });
return from(updatedSession);
},
async deleteSession(sessionToken) {
const { value: session } = await (await db).S.findOneAndDelete({
const session = await (await db).S.findOneAndDelete({
sessionToken,

@@ -219,10 +219,9 @@ });

async useVerificationToken(identifier_token) {
const { value: verificationToken } = await (await db).V.findOneAndDelete(identifier_token);
const verificationToken = await (await db).V.findOneAndDelete(identifier_token);
if (!verificationToken)
return null;
// @ts-expect-error
delete verificationToken._id;
return verificationToken;
const { _id, ...rest } = verificationToken;
return rest;
},
};
}
{
"name": "@auth/mongodb-adapter",
"version": "1.0.0",
"version": "2.0.0",
"description": "MongoDB adapter for Auth.js",

@@ -37,15 +37,15 @@ "homepage": "https://authjs.dev",

"dependencies": {
"@auth/core": "0.8.2"
"@auth/core": "0.14.0"
},
"peerDependencies": {
"mongodb": "^5 || ^4"
"mongodb": "^6"
},
"devDependencies": {
"jest": "^27.4.3",
"mongodb": "^5.1.0",
"@next-auth/adapter-test": "0.0.0",
"@next-auth/tsconfig": "0.0.0"
"mongodb": "^6.0.0",
"@auth/adapter-test": "0.0.0",
"@auth/tsconfig": "0.0.0"
},
"jest": {
"preset": "@next-auth/adapter-test/jest"
"preset": "@auth/adapter-test/jest"
},

@@ -52,0 +52,0 @@ "scripts": {

@@ -196,3 +196,3 @@ /**

return from<AdapterUser>(result.value!)
return from<AdapterUser>(result!)
},

@@ -214,3 +214,3 @@ async deleteUser(id) {

async unlinkAccount(provider_providerAccountId) {
const { value: account } = await (
const account = await (
await db

@@ -240,3 +240,3 @@ ).A.findOneAndDelete(provider_providerAccountId)

const result = await (
const updatedSession = await (
await db

@@ -248,6 +248,6 @@ ).S.findOneAndUpdate(

)
return from<AdapterSession>(result.value!)
return from<AdapterSession>(updatedSession!)
},
async deleteSession(sessionToken) {
const { value: session } = await (
const session = await (
await db

@@ -264,3 +264,3 @@ ).S.findOneAndDelete({

async useVerificationToken(identifier_token) {
const { value: verificationToken } = await (
const verificationToken = await (
await db

@@ -270,7 +270,6 @@ ).V.findOneAndDelete(identifier_token)

if (!verificationToken) return null
// @ts-expect-error
delete verificationToken._id
return verificationToken
const { _id, ...rest } = verificationToken;
return rest;
},
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc