@auth/mongodb-adapter
Advanced tools
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23412
580
+ Added@auth/core@0.14.0(transitive)
+ Added@types/whatwg-url@11.0.5(transitive)
+ Addedbson@6.9.0(transitive)
+ Addedmongodb@6.10.0(transitive)
+ Addedmongodb-connection-string-url@3.0.1(transitive)
+ Addedtr46@4.1.1(transitive)
+ Addedwhatwg-url@13.0.0(transitive)
- Removed@auth/core@0.8.2(transitive)
- Removed@types/node@22.9.0(transitive)
- Removed@types/whatwg-url@8.2.2(transitive)
- Removedbson@5.5.1(transitive)
- Removedip-address@9.0.5(transitive)
- Removedjsbn@1.1.0(transitive)
- Removedmongodb@5.9.2(transitive)
- Removedmongodb-connection-string-url@2.6.0(transitive)
- Removedsmart-buffer@4.2.0(transitive)
- Removedsocks@2.8.3(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedtr46@3.0.0(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedwhatwg-url@11.0.0(transitive)
Updated@auth/core@0.14.0