diff --git a/lib/oauth3.js b/lib/oauth3.js index ff7f942..f500034 100644 --- a/lib/oauth3.js +++ b/lib/oauth3.js @@ -202,7 +202,7 @@ function verifyToken(token) { try { return jwt.verify(token, require('jwk-to-pem')(res.data), opts); } catch (err) { - if ('TokenExpiredError' === err.code) { + if ('TokenExpiredError' === err.name) { return PromiseA.reject({ message: 'TokenExpiredError: jwt expired' , code: 'E_TOKEN_EXPIRED'