force jws to always parse the payload as JSON

since the verify code assumes properties like `payload.aud` and `payload.exp` it seems reasonable to force jws to always parse the payload as JSON or else these properties won't exist.
This commit is contained in:
Ben Hockey
2014-08-23 17:25:11 -05:00
parent 64f4860623
commit c0267ad35b
+1 -1
View File
@@ -1,7 +1,7 @@
var jws = require('jws');
module.exports.decode = function (jwt) {
var decoded = jws.decode(jwt);
var decoded = jws.decode(jwt, {json: true});
return decoded && decoded.payload;
};