Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated Next-Auth v4 MongoDB adapter which is broken with MongoDB nodejs driver v6+ #10842

Open
huksley opened this issue May 7, 2024 · 0 comments
Labels
adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@huksley
Copy link

huksley commented May 7, 2024

Adapter type

@auth/mongodb-adapter

Environment

"mongodb": "^6.6.1",
"next": "^14.1.0",
"next-auth": "^4.24.7",
"@next-auth/mongodb-adapter": "^1.1.3",

Reproduction URL

https://github.com/huksley/next-auth-v4-mongodb-6

Describe the issue

The MongoDB adapter provided in v4 branch is outdated and actually version 1.1.1 while version on NPMJS is 1.1.3 https://github.com/nextauthjs/next-auth/tree/v4

MongoDB new native driver v6 works differently,
in particular db.collection.findOneAndDelete method returns a different output.

The new @authjs/mongodb-adapter handles this properly (and properly declares MongoDB as peer dependency) so this code needs to be backported to next-auth v4 branch and new adapter released.

How to reproduce

  1. Use MongoDB nodejs package v6.x with next-auth and @next-auth/mongodb-adapter
  2. Try email provider auth + JWT - it does not work

Expected behavior

Updated MongoDB adapter which is compatible with actively maintained MongoDB driver.

@huksley huksley added adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant