Skip to content

Commit

Permalink
confiremToken.js verify bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wellCh4n committed May 22, 2018
1 parent dd91b27 commit 3faa80e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/middlewares/confirmToken.js
Expand Up @@ -10,10 +10,14 @@ const confirmToken = (req, res, next) => {
jwt.verify(token, secret.cert, function (err) {
if (err) {
res.status(401).end(err.message)
} else {
// 通过验证才执行 next()
next()
}
})
}
next()
// 如果 next() 写在这里不管验证结果如何 虽然提示报错 但是依然会执行后面的逻辑
// next()
}

module.exports = confirmToken

0 comments on commit 3faa80e

Please sign in to comment.