Skip to content
Snippets Groups Projects
Commit b71b2fce authored by Lucas Gabriel Lima's avatar Lucas Gabriel Lima
Browse files

small fix on commentary

parent 434a5106
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!25Auth
Pipeline #
...@@ -24,6 +24,9 @@ module.exports = function(passport){ ...@@ -24,6 +24,9 @@ module.exports = function(passport){
}; };
/* To check if a user has access to a route, one must use passport.authenticate() specifying 'JWT' as the strategy in the route declaration, like so: /* To check if a user has access to a route, one must use passport.authenticate() specifying 'JWT' as the strategy in the route declaration, like so:
//pass passportfor configuration
require('./config/passport')(passport);
app.post('/route', passport.authenticate('jwt', { session: false}), function(req, res) { }); app.post('/route', passport.authenticate('jwt', { session: false}), function(req, res) { });
the user object is then accessible via req.user the user object is then accessible via req.user
...@@ -48,3 +51,4 @@ var token = getToken(req.headers); ...@@ -48,3 +51,4 @@ var token = getToken(req.headers);
if (token) { if (token) {
var decoded = jwt.decode(token, config.get(mongodb.secret)); var decoded = jwt.decode(token, config.get(mongodb.secret));
} }
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment