hoangvvo / nextjs-mongodb-app

A Next.js and MongoDB web application, designed with simplicity for learning and real-world applicability in mind.
https://nextjs-mongodb.now.sh/
MIT License
1.54k stars 289 forks source link

Sessions stored in a database named "test" instead of the actual database #102

Closed StarAzure closed 4 years ago

StarAzure commented 4 years ago

In local, I can specify the full database name:

MONGODB_URI=mongodb+srv://<user><pass>@clustername.mongodb.net/<DBNAME>

On vercel, the mongoDBAtlas integration does not have the option to edit/specify the dbname. It simply links a project to a cluster.

When the user sign up, the user gets created in the actual database. Immediately after, the user logs in but the session gets stored in "test" database

Looks like a bug for production when using Vercel?