Easily testing login authentication using Passport.js, MongoDB, and Next.js found on Github
Hello, I'm incompetent.
I found something that looked easy, so I'll test it out.
https://github.com/tsaxena4k/NextAuthX-Next.js-Mongodb-Authentication-App
git clone https://github.com/tsaxena4k/NextAuthX-Next.js-Mongodb-Authentication-App
Then, move to the directory (I initially did npm install dotenv, but then I saw it in package.json, so it wasn't necessary)
npm install
Before configuring .env, I'll set up MongoDB.
Enter cli mode with mongosh
use admin
admin> db.createUser({user:"mongo", pwd:"test", roles:["root"]})
I'll create a user named 'mongo' with a password 'test', which is a garbage password.
Then vim .env
MONGODB_URI=mongodb://mongo:test@localhost:27017/dbname?authSource=admin
MONGODB_DB=dbname
and set it up.
npm run dev
Then...
~
opensslErrorStack: [
'error:03000086:digital envelope routines::initialization error',
'error:0308010C:digital envelope routines::unsupported'
],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v21.7.3
I got an error....
So,
NODE_OPTIONS=--openssl-legacy-provider npm run dev
it works, so accessing http://localhost:3000/ shows it's running.
Hmm, how easy this is!!!!!!!!!! So grateful...