Created
November 30, 2018 09:42
-
-
Save Mirch/0ebd9a5ea8d44268583d50582faf8aa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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