Closed timsoraro closed 3 years ago
I somehow solved the problem by adding:
const options = {
site: process.env.NEXTAUTH_URL,
Strange. @timsoraro which version of next-auth
are you using? Since version 3, options.site has no meaning.
I'm using "^3.1.0".
Okay, you are right, it's not that. I'm not really sure what solved it.
Okay I noticed that this will cause the problem I reported orginially:
database: {
type: "mongodb",
uri: process.env.MONGO_URI,
w: "majority",
useNewUrlParser: true,
useUnifiedTopology: true,
retryWrites: true,
synchronize: true
},
Which is solved by:
database: process.env.MONGO_URI,
But i got ot say it didn't work when I tried before (so maybe something in my URI got fixed?).
I am seeing the same issue with mongoDB hosted on Atlas. @timsoraro does your URI just mongodb+srv://user:password@xxxx.xxx.mongodb.net/db_name
or are you also including any other flags? Because that doesn't seem to be solving it for me.
@centerjustified yep, just like that without any flags. Did you try using a new user that is not the admin (just throwing some ideas here)?
@timsoraro originally I was using an admin user. Created a new next-auth user with read/write access to just the one database. That didn't solve the issue. I appreciate you throwing out ideas. Are you using the same user for your general data connections and your auth connections?
Yes. Throwing more ideas:
npm cache clean --force
.I'm also getting this issue, could we reopen the issue? I've tried:
database: process.env.DATABASE_URL
with dmongodb+srv://dev:password@xxxx.xxx.mongodb.net/mydatabase
npm cache clean --force
Any other ideas @timsoraro @centerjustified ? Thanks!
I'm not sure if it's a problem with next-auth or my configuration. I'm trying to implement this example repo https://github.com/nextauthjs/next-auth-example using mongodb.
I setup a mongo database on Atlas. These are my files:
.env
Of course, I changed the real values.
/pages/api/[...nextauth].js
When running 'npm run dev` I get to the login page but when I submit an email address the browser stuck loading and it prints this:
and after some time the console then prints this:
I tried many things but nothing helped, I'll appreciate your help,
Thanks