Refactored and Cleaned Code for Understanding Authentication in Node.js using Sessions and Cookies.
In this project, I kept things simple and hammered in the concepts behind using Sessions and Cookies for Authentication.
To use this code do the following:
- Clone this repo or download it.
- Navigate into the location you downloaded folder in your cmd/bash/terminal
- Run
npm install
to install all the depends in this projects (bcryptjs, config, connect-mongodb-session, ejs, express, express-session and mongoose). - Check inside of the config folder under the default.json for the mongodb URI and insert your own connection string.