GT2/GT2-iOS/node_modules/jsonwebtoken/test/keyid.tests.js

10 lines
304 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
var jwt = require('../index');
var claims = {"name": "doron", "age": 46};
jwt.sign(claims, 'secret', {"keyid": "1234"}, function(err, good) {
console.log(jwt.decode(good, {"complete": true}).header.kid);
jwt.verify(good, 'secret', function(err, result) {
console.log(result);
})
});