nodejs jsonwebtoken verify报错 jwt not active

nodejs jsonwebtoken verify方法报错jwt not active
err = {
name: ‘NotBeforeError’,
message: ‘jwt not active’,
date: 2018-10-04T16:10:44.000Z
}
由于服务器时间差导致 jwt 报 jwt not active
解决:将jsonwebtoken verify的ignoreNotBefore 设置为 true
const decoded = jwt.verify(token, wrong-secret, {ignoreNotBefore: true},callback);
参考:
https://github.com/auth0/node-jsonwebtoken

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章