Skip to content

Instantly share code, notes, and snippets.

@shiningabdul
Created September 12, 2017 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiningabdul/9fd95d61edbe77f30f15fa6517f7d861 to your computer and use it in GitHub Desktop.
Save shiningabdul/9fd95d61edbe77f30f15fa6517f7d861 to your computer and use it in GitHub Desktop.
read_a_user = function(req, res) {
var userId = [req.params.id];
// decodedToken is gotten by jwt.verify(token, config.secretForJWT);
// assume the original object that was passed when creating the user had an id
if (req.decodedToken.id === userId) {
// get the user and do anything else needed
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment