This is a simple blog and code snippet about local authentication in Express JS using Passport JS . Using this we can authenticate using an email-password combination or using a username-password combination.

This is not an in-depth explanation, rather it’s just like a code snippet. For more information you can refer to the video tutorial given below 😊.

Project Setup

Setting up our project is fairly simple. We will use npm to initialize a project and will further install express for our express app , ejs for templating and mongoose for connecting to our mongoDB database.

npm init --yes npm i express…

Desi Programmer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store