Skip to content

Instantly share code, notes, and snippets.

@Mirch
Created November 30, 2018 09:42
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 Mirch/0ebd9a5ea8d44268583d50582faf8aa0 to your computer and use it in GitHub Desktop.
Save Mirch/0ebd9a5ea8d44268583d50582faf8aa0 to your computer and use it in GitHub Desktop.
app.post('/api/posts', verifyToken,
(req, res) => {
jwt.verify(req.token, 'secretkey',
(err, authData) => {
if (err) {
res.sendStatus(403);
} else {
res.json({
message: 'Post created...',
authData
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment