Each protected route pass through this Module.
Passport Module hadle with recive a token authentication
from some client that is intent to interact with CUC API and check if the received
token is valid. Case its VALID proced to route Case its NOT-VALID return 401 status
code and unauthorized message
Methods
-
inner protect()
-
Protect Middleware Method. Receives a token from passport module and checks the token still valid and belongs an valid User on mongodb User Collection.
- To Do:
-
- Write comments