Skip to content

A simple app in node.js, using passport.js to authenticate users and let them view some content based on their roles

Notifications You must be signed in to change notification settings

giannispan/role_based_view_content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

role_based_view_content

A simple app in node.js (no ui), using passport.js to authenticate users and let them view some content based on their roles

Make user you have node.js and mongodb running in port 27017. Before you start the server uncommnet line 12 in server.js

  1. Run "npm install"
  2. Run "node server.js"

In postman visit make a post request : http://localhost:8080/api/auth/login and provide in body request email and password from your mongo db. Then having the token provided after authentication you can make some get requests as defined in routes/index.js (eg. http://localhost:8080/api/viewDepartmentDocs) by passing the token to the headers. You can login with diffent users in order to see how roles work.

About

A simple app in node.js, using passport.js to authenticate users and let them view some content based on their roles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published