We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec32b20 commit 851bda2Copy full SHA for 851bda2
index.js
@@ -6,7 +6,8 @@ var TokenExpiredError = module.exports.TokenExpiredError = require('./lib/TokenE
6
module.exports.decode = function (jwt, options) {
7
options = options || {};
8
var decoded = jws.decode(jwt, options);
9
- var payload = decoded && decoded.payload;
+ if (!decoded) { return null; }
10
+ var payload = decoded.payload;
11
12
//try parse the payload
13
if(typeof payload === 'string') {
0 commit comments