That's a good example of an Authentication with nodejs and mongoDB, I just use bcrypt to encrypt the password, this way, you don't work with a plain password but only with encrypted passwords.
Comment hidden by post author - thread only visible in this permalink
I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
That's a good example of an Authentication with nodejs and mongoDB, I just use bcrypt to encrypt the password, this way, you don't work with a plain password but only with encrypted passwords.
Please read my reply to see why you shouldn't roll your own Authentication, and why this is not a good example of doing it.