- User enters username and password
- The application checks if they are matching
- If they are matching, it sends a
Set-Cookie
header that will be used to authenticate further pages - When the user visits pages from the same domain, the previously set cookie will be added to all the requests
- Authenticate restricted pages with this cookie
- Setup Express
- Setup Passport for Node JS
- Add protected endpoints
npm install --save express passport express-session connect-redis