Instantly share code, notes, and snippets.

@Mirch /post.js
Created Nov 30, 2018

Embed
What would you like to do?
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