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

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