nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.06k stars 3.33k forks source link

Incorrect type passed for MongoDBAdapter example #11432

Closed abmummaneni closed 1 month ago

abmummaneni commented 1 month ago

What is the improvement or update you wish to see?

Change all instances of client to client.connect() in the MongoDBAdapter example.

Is there any context that might help us understand?

The parameter type for MongoDBAdapter() is Promise<MongoClient> | (() => Promise<MongoClient>). However, the documentation currently passes client which is of type MongoClient. This can be fixed by calling the .connect() function on the client object which returns a Promise<MongoClient> type.

Does the docs page already exist? Please link to it.

https://authjs.dev/getting-started/adapters/mongodb

Jay-Karia commented 1 month ago

Is there any documentation for MongoDB Adapter mentioning this?