<script type="text/javascript">
function parseQuote(response) {
document.getElementById("quote").innerHTML = response.quoteText;
document.getElementById("author").innerHTML = response.quoteAuthor;
}
</script>
<div class="rocketquote" style="padding: 20px; opacity: 0.3; font-style: italic; cursor: pointer;">
<a href="" onclick="">
<p id="quote"></p><br>
<p style="font-style: normal" id="author"></p>
</a>
</div>
<script type="text/javascript" src="https://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&jsonp=parseQuote"></script>
function verify() {
return new Promise(function(resolve, reject) {
jwt.verify(token, process.env.SECRET, function(err, decoded) {
resolve(decoded) // или reject - это уж вам виднее
if (err) {
res.status(401).send({
message: 'Unable to verify email. Probably, your token is expired.'
})
return
}
})
})
}
verify().then(function(decoded) {
// обрабатываем decoded
})